public Server() { server = this; ReadItemSet(); Socket _server = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); IPEndPoint _ipep = new IPEndPoint(IPAddress.Any, 50005); _server.Bind(_ipep); _server.Listen(20); Console.WriteLine("Handle of server process: " + _server.Handle.ToInt32()); SocketAsyncEventArgs _args = new SocketAsyncEventArgs(); _args.Completed += new EventHandler<SocketAsyncEventArgs>(Accept_Completed); _server.AcceptAsync(_args); SetTimer(); DataInput(); }
static void Main(string[] args) { server = new Server(); }