public override bool Start(IServerConfig config) { bool flag = true; listenSocket = new Socket(ListenerInfo.IpEndPoint.AddressFamily, SocketType.Stream, ProtocolType.Tcp); try { listenSocket.Bind(ListenerInfo.IpEndPoint); listenSocket.Listen(ListenerInfo.BackLog); SocketAsyncEventArgs tempSocketAsyncEventArgs = new SocketAsyncEventArgs(); socketAsyncEventArgs = tempSocketAsyncEventArgs; tempSocketAsyncEventArgs.Completed += TempSocketAsyncEventArgs_Completed; bool willRaiseEvent = listenSocket.AcceptAsync(tempSocketAsyncEventArgs); if (willRaiseEvent == false) { ProcessAccept(tempSocketAsyncEventArgs); } } catch (Exception ex) { OnError(new ErrorEventArgs {Exception = ex}); flag = false; } return flag; }