Module bus.http

Interface WebSocket.Factory

All Known Implementing Classes:
Httpd
Enclosing interface:
WebSocket

public static interface WebSocket.Factory
A factory for creating WebSockets.
  • Method Details

    • newWebSocket

      WebSocket newWebSocket(Request request, WebSocketListener listener)
      Creates a new web socket and immediately returns it. Creating a web socket initiates an asynchronous process to connect the socket. Once the socket is successfully connected or fails to connect, the listener will be notified. The caller must either close or cancel the returned web socket when it is no longer in use.
      Parameters:
      request - The HTTP request to upgrade to a WebSocket.
      listener - The listener to receive events for this WebSocket.
      Returns:
      The new WebSocket.