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 { } } }
public void SendClientPacket(ServerRouterSession client, RouterPacket msg) { queuedOutgoingPackets.Enqueue(new Tuple <T, RouterPacket>((T)client, msg)); }
public void OnIncomingClientMessage(ServerRouterSession client, RouterMessage msg) { OnClientMessage?.Invoke((T)client, msg); }