Interface WebSocketListener
- All Known Implementing Classes:
WebSocketAdapter
,WebSocketApplication
WebSocket
instances.-
Method Summary
Modifier and TypeMethodDescriptionvoid
Invoked whenWebSocket.onClose(DataFrame)
has been called on a particularWebSocket
instance.void
Invoked when the opening handshake has been completed for a specificWebSocket
instance.void
onFragment
(WebSocket socket, byte[] fragment, boolean last) Invoked whenWebSocket.onFragment(boolean, byte[])
has been called on a particularWebSocket
instance.void
onFragment
(WebSocket socket, String fragment, boolean last) Invoked whenWebSocket.onFragment(boolean, String)
has been called on a particularWebSocket
instance.void
Invoked whenWebSocket.onMessage(String)
has been called on a particularWebSocket
instance.void
Invoked whenWebSocket.onMessage(String)
has been called on a particularWebSocket
instance.void
Invoked whenWebSocket.onPing(DataFrame)
has been called on a particularWebSocket
instance.void
Invoked whenWebSocket.onPong(DataFrame)
has been called on a particularWebSocket
instance.
-
Method Details
-
onClose
Invoked when
WebSocket.onClose(DataFrame)
has been called on a particularWebSocket
instance. -
onConnect
Invoked when the opening handshake has been completed for a specific
WebSocket
instance.- Parameters:
socket
- the newly connectedWebSocket
-
onMessage
Invoked when
WebSocket.onMessage(String)
has been called on a particularWebSocket
instance.- Parameters:
socket
- theWebSocket
that received a message.text
- the message received.
-
onMessage
Invoked when
WebSocket.onMessage(String)
has been called on a particularWebSocket
instance.- Parameters:
socket
- theWebSocket
that received a message.bytes
- the message received.
-
onPing
Invoked when
WebSocket.onPing(DataFrame)
has been called on a particularWebSocket
instance.- Parameters:
socket
- theWebSocket
that received the ping.bytes
- the payload of the ping frame, if any.
-
onPong
Invoked when
WebSocket.onPong(DataFrame)
has been called on a particularWebSocket
instance.- Parameters:
socket
- theWebSocket
that received the pong.bytes
- the payload of the pong frame, if any.
-
onFragment
Invoked when
WebSocket.onFragment(boolean, String)
has been called on a particularWebSocket
instance.- Parameters:
socket
- theWebSocket
received the message fragment.fragment
- the message fragment.last
- flag indicating if this was the last fragment.
-
onFragment
Invoked when
WebSocket.onFragment(boolean, byte[])
has been called on a particularWebSocket
instance.- Parameters:
socket
- theWebSocket
received the message fragment.fragment
- the message fragment.last
- flag indicating if this was the last fragment.
-