close method

Future close()

Implementation

Future close() async {
  await _listener?.cancel();
  _listener = null;
  _socket?.destroy();
  _socket = null;
  _heartbeatTimer?.cancel();
  _heartbeatTimer = null;
  status = OnyxConnectionStatus.disconnected;
}