--
中斷 Tcp 連線
public System.Net.Sockets.TcpClient tcpClient;
if (this.tcpClient != null)
{
this.tcpClient.Client.Shutdown(System.Net.Sockets.SocketShutdown.Both);
this.tcpClient.Client.Close();
this.tcpClient.Close();
this.tcpClient = null;
}
//===========================================================
取得client端的ip
System.Net.IPEndPoint p = (System.Net.IPEndPoint)tcpClient.Client.RemoteEndPoint;
string IP = p.Address.ToString();
沒有留言:
張貼留言