close method

void close()

Close the connection

Implementation

void close() {
  if (_isConnected && WebSocketInterceptor.isEnabled && _connectionId != null) {
    WebSocketInterceptor.captureEvent(
      connectionId: _connectionId!,
      type: WebSocketEventType.disconnect,
    );
  }
  _isConnected = false;
}