62,253
社区成员
发帖
与我相关
我的任务
分享
this.m_IP = server;
this.m_Port = port;
IPHostEntry hostEntry = Dns.GetHostEntry(this.m_IP);
IPEndPoint ipe = new IPEndPoint(hostEntry.AddressList[0], this.m_Port);
this.m_Socket = new Socket(ipe.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
try
{
this.m_Socket.Connect(ipe);
}
catch
{
}