当启动服务端的时候 就需要在服务端创建socket 启动监听
Socket listener = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
IPEndPoint localEndPoint = new IPEndPoint(IPAddress.Any, 13001);
listener.Bind(localEndPoint);
listener.Listen(10);
listener.BeginAccept(
new AsyncCallback(AcceptCallback),
listener);
当接收到客户端的请求时会调用AcceptCallback;