Exemple #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);
        }
Exemple #2
0
 private void NotifySocketClientAccepted(TCPClient socket)
 {
     var evnt = SocketClientAccepted;
     if (evnt != null)
         evnt(socket);
 }