Unconfirmed, but I would try the following:
TcpListener listener = new TcpListener(IPAddress.Any, port); TcpClient client = listener.AcceptTcpClient(); IPEndPoint endPoint = (IPEndPoint) client.Client.RemoteEndPoint;
If you can do with IPAddress, I would skip the reverse DNS lookup, but you specifically asked for the host name.
Rasmus faber
source share