Пример #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 { }
            }
        }
Пример #2
0
 public void SendClientPacket(ServerRouterSession client, RouterPacket msg)
 {
     queuedOutgoingPackets.Enqueue(new Tuple <T, RouterPacket>((T)client, msg));
 }
Пример #3
0
 public void OnIncomingClientMessage(ServerRouterSession client, RouterMessage msg)
 {
     OnClientMessage?.Invoke((T)client, msg);
 }