Package play.mvc

Class WebSocket.MappedWebSocketAcceptor<In,Out>

java.lang.Object
play.mvc.WebSocket.MappedWebSocketAcceptor<In,Out>
Type Parameters:
In - the type the websocket reads from clients (e.g. String, JsonNode)
Out - the type the websocket outputs back to remote clients (e.g. String, JsonNode)
Enclosing class:
WebSocket

public static class WebSocket.MappedWebSocketAcceptor<In,Out> extends Object
Utility class for creating WebSockets.
  • Constructor Details

  • Method Details

    • acceptOrResult

      Accept a WebSocket.
      Parameters:
      f - A function that takes the request header, and returns a future of either the result to reject the WebSocket connection with, or a flow to handle the WebSocket messages.
      Returns:
      The WebSocket handler.
    • accept

      Accept a WebSocket.
      Parameters:
      f - A function that takes the request header, and returns a flow to handle the WebSocket messages.
      Returns:
      The WebSocket handler.