Esempio n. 1
0
        public void DropClient(ServerRouterSession clientIn)
        {
            T    client = (T)clientIn;
            bool exists;

            lock (connectedClients)
            {
                exists = connectedClients.Contains(client);
                if (exists)
                {
                    connectedClients.Remove(client);
                }
            }
            if (exists)
            {
                OnClientDropped?.Invoke(client);
                try
                {
                    client.sock.Close();
                    client.sock.Dispose();
                }
                catch { }
            }
        }
Esempio n. 2
0
 public void SendClientPacket(ServerRouterSession client, RouterPacket msg)
 {
     queuedOutgoingPackets.Enqueue(new Tuple <T, RouterPacket>((T)client, msg));
 }
Esempio n. 3
0
 public void OnIncomingClientMessage(ServerRouterSession client, RouterMessage msg)
 {
     OnClientMessage?.Invoke((T)client, msg);
 }