public override void Disconnect(bool reuseSocket) { if (!ActsAsServer) { return; // NO-OP for "client" sockets. } // Clear all clients. this.Clients?.Clear(); // Cancel listening thread. ServerTaskCancellationTokenSource?.Cancel(); // Disconnect underlying socket. UnderlyingSocket.Disconnect(reuseSocket); }
public override void Disconnect(bool reuseSocket) => UnderlyingSocket.Disconnect(reuseSocket);