Exemplo n.º 1
0
        private void AcceptCallback(IAsyncResult ar)
        {
            var handler = Listener.EndAccept(ar);

            Listener.BeginAccept(new AsyncCallback(AcceptCallback), null);

            var clientHandler = new SocketServerConnection(handler, this);

            clientHandler.OnClose += OnClientHandler_Close;
            Connections.Add(clientHandler);

            clientHandler.Start();
        }
Exemplo n.º 2
0
 private void OnClientHandler_Close(SocketServerConnection sender)
 {
     Connections.Remove(sender);
 }