Ejemplo n.º 1
0
        protected override void AcceptedSocket(TinySocket sock)
        {
            var client = new TCPClient(sock);

            lock (Clients)
                Clients.Add(client);

            sock.OnSocketClosedEvent += () =>
                {
                    lock (Clients)
                        Clients.Remove(client);
                };

            NotifySocketClientAccepted(client);
        }
Ejemplo n.º 2
0
 private void NotifySocketClientAccepted(TCPClient socket)
 {
     var evnt = SocketClientAccepted;
     if (evnt != null)
         evnt(socket);
 }