interface SubProtocolHandler
A contract for handling WebSocket messages as part of a higher level protocol, referred to as "sub-protocol" in the WebSocket RFC specification. Handles both WebSocketMessages from a client as well as Messages to a client.
Implementations of this interface can be configured on a SubProtocolWebSocketHandler which selects a sub-protocol handler to delegate messages to based on the sub-protocol requested by the client through the Sec-WebSocket-Protocol request header.
Author
Andy Wilkinson
Author
Rossen Stoyanchev
Since
4.0
abstract fun afterSessionEnded(session: WebSocketSession, closeStatus: CloseStatus, outputChannel: MessageChannel): Unit
Invoked after a WebSocketSession has ended. |
|
abstract fun afterSessionStarted(session: WebSocketSession, outputChannel: MessageChannel): Unit
Invoked after a WebSocketSession has started. |
|
abstract fun getSupportedProtocols(): MutableList<String>
Return the list of sub-protocols supported by this handler (never |
|
abstract fun handleMessageFromClient(session: WebSocketSession, message: WebSocketMessage<*>, outputChannel: MessageChannel): Unit
Handle the given WebSocketMessage received from a client. |
|
abstract fun handleMessageToClient(session: WebSocketSession, message: Message<*>): Unit
Handle the given Message to the client associated with the given WebSocket session. |
|
abstract fun resolveSessionId(message: Message<*>): String
Resolve the session id from the given message or return |