-
- All Implemented Interfaces:
-
com.tds.common.websocket.conn.WebSocketListener
public abstract class WebSocketAdapter implements WebSocketListener
This class default implements all methods of the WebSocketListener that can be overridden optionally when advances functionalities is needed.
-
-
Method Summary
Modifier and Type Method Description ServerHandshakeBuilder
onWebsocketHandshakeReceivedAsServer(WebSocket conn, Draft draft, ClientHandshake request)
This default implementation does not do anything. void
onWebsocketHandshakeReceivedAsClient(WebSocket conn, ClientHandshake request, ServerHandshake response)
Called on the client side when the socket connection is first established, and theWebSocketImpl handshake response has been received. void
onWebsocketHandshakeSentAsClient(WebSocket conn, ClientHandshake request)
This default implementation does not do anything which will cause the connections to alwaysprogress. void
onWebsocketPing(WebSocket conn, Framedata f)
This default implementation will send a pong in response to the received ping. void
onWebsocketPong(WebSocket conn, Framedata f)
This default implementation does not do anything. PingFrame
onPreparePing(WebSocket conn)
Default implementation for onPreparePing, returns a (cached) PingFrame that has no applicationdata. -
Methods inherited from class com.tds.common.websocket.conn.WebSocketListener
getLocalSocketAddress, getRemoteSocketAddress, onWebsocketClose, onWebsocketCloseInitiated, onWebsocketClosing, onWebsocketError, onWebsocketHandshakeReceivedAsClient, onWebsocketHandshakeReceivedAsServer, onWebsocketMessage, onWebsocketMessage, onWebsocketOpen, onWriteDemand
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
onWebsocketHandshakeReceivedAsServer
ServerHandshakeBuilder onWebsocketHandshakeReceivedAsServer(WebSocket conn, Draft draft, ClientHandshake request)
This default implementation does not do anything. Go ahead and overwrite it.
-
onWebsocketHandshakeReceivedAsClient
void onWebsocketHandshakeReceivedAsClient(WebSocket conn, ClientHandshake request, ServerHandshake response)
Called on the client side when the socket connection is first established, and theWebSocketImpl handshake response has been received.
- Parameters:
conn
- The WebSocket related to this eventrequest
- The handshake initially send out to the server by this websocket.response
- The handshake the server sent in response to the request.
-
onWebsocketHandshakeSentAsClient
void onWebsocketHandshakeSentAsClient(WebSocket conn, ClientHandshake request)
This default implementation does not do anything which will cause the connections to alwaysprogress.
-
onWebsocketPing
void onWebsocketPing(WebSocket conn, Framedata f)
This default implementation will send a pong in response to the received ping. The pong framewill have the same payload as the ping frame.
-
onWebsocketPong
void onWebsocketPong(WebSocket conn, Framedata f)
This default implementation does not do anything. Go ahead and overwrite it.
-
onPreparePing
PingFrame onPreparePing(WebSocket conn)
Default implementation for onPreparePing, returns a (cached) PingFrame that has no applicationdata.
- Parameters:
conn
- The WebSocket connection from which the ping frame will be sent.
-
-
-
-