disconnect method

Future<bool> disconnect()

Implementation

Future<bool> disconnect() async {
  LayrzProtocolSocket.isActive = false;
  _log.info('Disconnecting from the server');
  await _socket?.close();
  _socket?.destroy();
  _socket = null;
  _eventController.add(TcpDisconnected());
  _log.info('Disconnected from the server');
  return true;
}