Package akka.http.impl.engine.ws
Class WebSocket
- java.lang.Object
-
- akka.http.impl.engine.ws.WebSocket
-
public class WebSocket extends java.lang.Object
INTERNAL APIDefines components of the websocket stack.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
WebSocket.Tick$
-
Constructor Summary
Constructors Constructor Description WebSocket()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static akka.stream.scaladsl.BidiFlow<FrameEventOrError,FrameHandler.Output,java.lang.Object,FrameStart,akka.NotUsed>
frameHandling(boolean serverSide, scala.concurrent.duration.FiniteDuration closeTimeout, akka.event.LoggingAdapter log)
The layer that implements all low-level frame handling, like handling control frames, collecting messages from frames, decoding text messages, close handling, etc.static akka.stream.scaladsl.BidiFlow<akka.util.ByteString,FrameEvent,FrameEvent,akka.util.ByteString,akka.NotUsed>
framing()
The lowest layer that implements the binary protocolstatic akka.stream.scaladsl.BidiFlow<FrameHandler.Output,FrameHandler.Output,java.lang.Object,java.lang.Object,akka.NotUsed>
idleTimeout(WebSocketSettings settings)
The layer that transparently monitors data flow in both directions and fails the flow withStreamIdleTimeoutException
if elements are not passed within configured time.static akka.stream.scaladsl.BidiFlow<FrameEvent,FrameEventOrError,FrameEvent,FrameEvent,akka.NotUsed>
masking(boolean serverSide, scala.Function0<java.util.Random> maskingRandomFactory)
The layer that handles masking using the rules defined in the specificationstatic akka.stream.scaladsl.BidiFlow<FrameHandler.Output,Message,Message,java.lang.Object,akka.NotUsed>
messageAPI(boolean serverSide, scala.concurrent.duration.FiniteDuration closeTimeout)
The layer that provides the high-level user facing API on top of frame handling.static akka.stream.scaladsl.BidiFlow<FrameHandler.Output,FrameHandler.Output,java.lang.Object,java.lang.Object,akka.NotUsed>
periodicKeepAlive(WebSocketSettings settings)
The layer that transparently injects (if enabled) keepAlive Ping or Pong messages when connection is idlestatic akka.stream.scaladsl.BidiFlow<FrameEvent,Message,Message,FrameEvent,akka.NotUsed>
stack(boolean serverSide, WebSocketSettings websocketSettings, scala.concurrent.duration.FiniteDuration closeTimeout, akka.event.LoggingAdapter log)
A stack of all the higher WS layers between raw frames and the user API.
-
-
-
Method Detail
-
stack
public static akka.stream.scaladsl.BidiFlow<FrameEvent,Message,Message,FrameEvent,akka.NotUsed> stack(boolean serverSide, WebSocketSettings websocketSettings, scala.concurrent.duration.FiniteDuration closeTimeout, akka.event.LoggingAdapter log)
A stack of all the higher WS layers between raw frames and the user API.- Parameters:
serverSide
- (undocumented)websocketSettings
- (undocumented)closeTimeout
- (undocumented)log
- (undocumented)- Returns:
- (undocumented)
-
framing
public static akka.stream.scaladsl.BidiFlow<akka.util.ByteString,FrameEvent,FrameEvent,akka.util.ByteString,akka.NotUsed> framing()
The lowest layer that implements the binary protocol
-
masking
public static akka.stream.scaladsl.BidiFlow<FrameEvent,FrameEventOrError,FrameEvent,FrameEvent,akka.NotUsed> masking(boolean serverSide, scala.Function0<java.util.Random> maskingRandomFactory)
The layer that handles masking using the rules defined in the specification
-
periodicKeepAlive
public static akka.stream.scaladsl.BidiFlow<FrameHandler.Output,FrameHandler.Output,java.lang.Object,java.lang.Object,akka.NotUsed> periodicKeepAlive(WebSocketSettings settings)
The layer that transparently injects (if enabled) keepAlive Ping or Pong messages when connection is idle
-
idleTimeout
public static akka.stream.scaladsl.BidiFlow<FrameHandler.Output,FrameHandler.Output,java.lang.Object,java.lang.Object,akka.NotUsed> idleTimeout(WebSocketSettings settings)
The layer that transparently monitors data flow in both directions and fails the flow withStreamIdleTimeoutException
if elements are not passed within configured time.- Parameters:
settings
- (undocumented)- Returns:
- (undocumented)
-
frameHandling
public static akka.stream.scaladsl.BidiFlow<FrameEventOrError,FrameHandler.Output,java.lang.Object,FrameStart,akka.NotUsed> frameHandling(boolean serverSide, scala.concurrent.duration.FiniteDuration closeTimeout, akka.event.LoggingAdapter log)
The layer that implements all low-level frame handling, like handling control frames, collecting messages from frames, decoding text messages, close handling, etc.- Parameters:
serverSide
- (undocumented)closeTimeout
- (undocumented)log
- (undocumented)- Returns:
- (undocumented)
-
messageAPI
public static akka.stream.scaladsl.BidiFlow<FrameHandler.Output,Message,Message,java.lang.Object,akka.NotUsed> messageAPI(boolean serverSide, scala.concurrent.duration.FiniteDuration closeTimeout)
The layer that provides the high-level user facing API on top of frame handling.- Parameters:
serverSide
- (undocumented)closeTimeout
- (undocumented)- Returns:
- (undocumented)
-
-