Benny,
In .NET 1.1 and before, if you get the TcpClient, you didn't have access
to the underlying socket. Because of this, you would have to call the
AcceptSocket method to get a socket, and then get the endpoint from there.
In .NET 2.0, the TcpClient class exposes the Client property, which will
give you access to the underlying Socket.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"Benny Raymond" <be***@pocketrocks.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
Is it possible to get the ip address of the pc connecting to my
TcpListener? Here's how my code works so far:
listener = new TcpListener(_myIP, _port);
listener.Start();
// block until we get a connection
TcpClient client = listener.AcceptTcpClient();
// at this point I need to store the IP address for
// future ref... but how!?
Any help would be great - thanks!