registerRelayWebSocket method

WebSocketChannel registerRelayWebSocket({
  1. required String relayUrl,
  2. required WebSocketChannel webSocket,
})

Registers a WebSocket to the registry with the given relayUrl. If a WebSocket is already registered with the given relayUrl, it will be replaced.

Implementation

WebSocketChannel registerRelayWebSocket({
  required String relayUrl,
  required WebSocketChannel webSocket,
}) {
  relaysWebSocketsRegistry[relayUrl] = webSocket;
  return relaysWebSocketsRegistry[relayUrl]!;
}