我正在使用 TcpListener 编写一个简单的 FTP 服务,并且想找出传入呼叫使用的主机名(具有多个子域的域)。
这可能吗?
//Barebone TCPListener example
System.Net.Sockets.TcpListener listener;
listener = new TcpListener(IPAddress.Any, 21)
listener.Start();
TcpClient client = listener.AcceptTcpClient();
//Great, incoming... what domain are they using to call my service?
//This only gives me the local and remote IP..
//IPEndPoint LocalEndPoint = (IPEndPoint)client.Client.LocalEndPoint;
//IPEndPoint RemoteEndPoint = (IPEndPoint)client.Client.RemoteEndPoint;
任何指针都非常感谢。