- All Known Implementing Classes:
ClientWsConnection
,WsConnection
public interface WsSession
WebSocket session.
-
Method Summary
Modifier and TypeMethodDescriptionClose session.ping
(BufferData bufferData) Send ping.pong
(BufferData bufferData) Send pong.send
(BufferData bufferData, boolean last) Send binary fragment.Send text fragment.The underlying socket context.The WebSocket sub-protocol negotiated for this session.Terminate session.
-
Method Details
-
send
Send text fragment.- Parameters:
text
- text to sendlast
- if last fragment- Returns:
- this instance
-
send
Send binary fragment.- Parameters:
bufferData
- buffer with datalast
- if last fragment- Returns:
- this instance
-
ping
Send ping.- Parameters:
bufferData
- buffer with data- Returns:
- this instance
-
pong
Send pong.- Parameters:
bufferData
- buffer with data- Returns:
- this instance
-
close
Close session.- Parameters:
code
- close code, may be one ofWsCloseCodes
reason
- reason description- Returns:
- this instance
-
terminate
WsSession terminate()Terminate session. Sends a close and closes the connection.- Returns:
- this instance
-
subProtocol
The WebSocket sub-protocol negotiated for this session.- Returns:
- sub-protocol negotiated, if any
-
socketContext
SocketContext socketContext()The underlying socket context.- Returns:
- socket context
-