ChatClient/ChatClient.cs
/// <summary>
/// Disconnects the client socket and stops raising events.
/// </summary>
Disconnects the client socket and stops raising events.
Disconnects the client socket and stops raising events .
public void Disconnect() {
            if (socket == null) {
                LogLine($"Null {nameof(socket)}", LogLevel.Warn);
                return;
            }
            socket.Close();
            socket.OnOpen -= Socket_OnOpen;
            socket.OnClose -= Socket_OnClose;
            socket.OnError -= Socket_OnError;
            socket.OnMessage -= Socket_OnMessage;
            socket = null;
        }
public void Disconnect ( ) { if ( socket == null ) { LogLine ( $" Null  { nameof ( socket ) } " , LogLevel . Warn ) ; return ; } socket . Close ( ) ; socket . OnOpen -= Socket_OnOpen ; socket . OnClose -= Socket_OnClose ; socket . OnError -= Socket_OnError ; socket . OnMessage -= Socket_OnMessage ; socket = null ; }
Disconnects the client socket and stops raising events.
Disconnects the client socket and stops raising events .