C_Socket编程实例.docVIP

  • 4
  • 0
  • 约6.49千字
  • 约 8页
  • 2016-12-29 发布于重庆
  • 举报
//Socket基本编程 //服务端: using System.Net; using System.Net.Sockets; using System.Text; using System.Threading; Thread mythread ; Socket socket; // 清理所有正在使用的资源。 protected override void Dispose( bool disposing ) {  try  {      socket.Close();//释放资源   mythread.Abort ( ) ;//中止线程  }  catch{ }  if( disposing )  {   if (components != null)   {    components.Dispose();   }  }  base.Dispose( disposing ); } public static IPAddress GetServerIP() {  IPHostEntry ieh=Dns.GetHostByName(Dns.GetHostName());  return ieh.AddressList[0]; } private void BeginListen() {  IPAddress ServerIp=G

文档评论(0)

1亿VIP精品文档

相关文档