Hi,
It depends on how you accept incoming TCP connections in the TcpListener. If
you use AcceptSocket, it will return you a Socket instance which you can
query for RemoteEndPoint property.
If you however use AcceptTcpClient, you will have to create a derived class
to access the protected TcpClient's Socket property.
--
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx
"R2D2" <R2**@discussions.microsoft.com> wrote in message
news:4D**********************************@microsof t.com...
Is there any way to resolve the ip address of the host machine or a
machine
at the other end of a network connection? I have created a client-server
Tcp
project that only uses the TcpClient and TcpListener classes for the
connections.
I have tried:
Dns.Resolve("localhost").Address[0].ToString();
but that only gives me "127.0.0.1"
I would prefer it though if I could resolve the address of the clients
from
the server, rather than having to pass the IpAddress across the network.
Any ideas?
Thanks