disconnect method

void disconnect()

Disconnects (if any) the socket and set _socket to the instance itself.

Otherwise, _socket is set to null.

Implementation

void disconnect() =>
    _socket = isConnected ? _socket = _socket!.disconnect() : null;