110,566
社区成员
发帖
与我相关
我的任务
分享
myserver=new IPEndPoint(IPAddress.Parse(this.textBox1.Text),Int32.Parse(this.textBox2.Text));
s=new Socket(AddressFamily.InterNetwork,SocketType.Stream,ProtocolType.Tcp);//构造套接字
s.Bind(myserver);//绑定套接字
s.Listen(1);//刮起连接队列的最大长度
//服务器启动
this.listBox1.Items.Add("服务器已经启动!");
InitClientList(); //初始化socket类数组
this.timer1.Enabled=true;
thread=new Thread(new ThreadStart(target));//开始线程
thread.Start();