Example #1
0
        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);
        }
Example #2
0
 public override void Disconnect(bool reuseSocket) =>
 UnderlyingSocket.Disconnect(reuseSocket);