close method

dynamic close()

Closes the WebSocket connection.

This method closes the WebSocket connection if it is open and nullifies the socket reference.

Implementation

close() {
  if (_socket != null) _socket?.close();
}