Interface WebSocketListener
- All Known Implementing Classes:
WebSocketAdapter,WebSocketApplication
WebSocket instances.-
Method Summary
Modifier and TypeMethodDescriptionvoidInvoked whenWebSocket.onClose(DataFrame)has been called on a particularWebSocketinstance.voidInvoked when the opening handshake has been completed for a specificWebSocketinstance.voidonFragment(WebSocket socket, byte[] fragment, boolean last) Invoked whenWebSocket.onFragment(boolean, byte[])has been called on a particularWebSocketinstance.voidonFragment(WebSocket socket, String fragment, boolean last) Invoked whenWebSocket.onFragment(boolean, String)has been called on a particularWebSocketinstance.voidInvoked whenWebSocket.onMessage(String)has been called on a particularWebSocketinstance.voidInvoked whenWebSocket.onMessage(String)has been called on a particularWebSocketinstance.voidInvoked whenWebSocket.onPing(DataFrame)has been called on a particularWebSocketinstance.voidInvoked whenWebSocket.onPong(DataFrame)has been called on a particularWebSocketinstance.
-
Method Details
-
onClose
Invoked when
WebSocket.onClose(DataFrame)has been called on a particularWebSocketinstance. -
onConnect
Invoked when the opening handshake has been completed for a specific
WebSocketinstance.- Parameters:
socket- the newly connectedWebSocket
-
onMessage
Invoked when
WebSocket.onMessage(String)has been called on a particularWebSocketinstance.- Parameters:
socket- theWebSocketthat received a message.text- the message received.
-
onMessage
Invoked when
WebSocket.onMessage(String)has been called on a particularWebSocketinstance.- Parameters:
socket- theWebSocketthat received a message.bytes- the message received.
-
onPing
Invoked when
WebSocket.onPing(DataFrame)has been called on a particularWebSocketinstance.- Parameters:
socket- theWebSocketthat received the ping.bytes- the payload of the ping frame, if any.
-
onPong
Invoked when
WebSocket.onPong(DataFrame)has been called on a particularWebSocketinstance.- Parameters:
socket- theWebSocketthat received the pong.bytes- the payload of the pong frame, if any.
-
onFragment
Invoked when
WebSocket.onFragment(boolean, String)has been called on a particularWebSocketinstance.- Parameters:
socket- theWebSocketreceived 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 particularWebSocketinstance.- Parameters:
socket- theWebSocketreceived the message fragment.fragment- the message fragment.last- flag indicating if this was the last fragment.
-