Package com.iizix.nio
Interface WebSocketCommListener
- All Known Subinterfaces:
- IServerWebSocketCommListener
- All Known Implementing Classes:
- AbstractEndPoint,- LoadBalancerEndPoint,- RemoteBuilderEndPoint,- ServerSession,- VirtualizedMonitorEndPoint
public interface WebSocketCommListener
The WebSocket communication listener.
- Author:
- Christopher Mindus
- Field SummaryFieldsModifier and TypeFieldDescription- static final intAbnormal Closure: iOS causes 1006 "Read EOF" if Safari is closed, or "Harsh disconnect" if just left alone for a long time.- static final intGoing Away: sent when e.g.- static final intInternal Error.- static final intInvalid frame payload data.- static final intMandatory Ext.- static final intMessage Too Big.- static final intNo Status Received: send when e.g.- static final intNormal Closure.- static final intPolicy Violation.- static final intProtocol error.- static final intService Restart.- static final intTLS handshake- static final intTry Again Later.- static final intUnsupported Data.
- Method SummaryModifier and TypeMethodDescription- void- onCommClosed- (IWebSocketComm comm, int code, String reason) Called when the communication link is closed.- void- onCommClosing- (IWebSocketComm comm) Called when the communication link is closing.- voidCalled when the communication link is connected.- void- onCommData- (IWebSocketComm comm, byte[] data, int offset, int len) Called when the communication link has received binary data.- void- onCommData- (IWebSocketComm comm, String data) Called when the communication link has received String data.- void- onCommError- (IWebSocketComm comm, Throwable e) Called when the communication link is closed.- void- onCommHeartBeat- (IWebSocketComm comm, long duration) Called when a heart-beat frame is received.- void- onCommOpen- (IWebSocketComm comm) Called when the communication link is opened.- void- onCommTimeout- (IWebSocketComm comm, boolean isReadTimeout) Called when the communication link has timed out on a read or write operation.
- Field Details- CC_NORMALstatic final int CC_NORMALNormal Closure.- See Also:
 
- CC_GOING_AWAYstatic final int CC_GOING_AWAYGoing Away: sent when e.g. IE closes a window.- See Also:
 
- CC_PROTOCOL_ERRORstatic final int CC_PROTOCOL_ERRORProtocol error.- See Also:
 
- CC_UNSUPPORTED_DATAstatic final int CC_UNSUPPORTED_DATAUnsupported Data.- See Also:
 
- CC_NO_STATUS_RECEIVEDstatic final int CC_NO_STATUS_RECEIVEDNo Status Received: send when e.g. JS performs Close without code/reason.- See Also:
 
- CC_ABNORMAL_CLOSUREstatic final int CC_ABNORMAL_CLOSUREAbnormal Closure: iOS causes 1006 "Read EOF" if Safari is closed, or "Harsh disconnect" if just left alone for a long time.- See Also:
 
- CC_INVALID_PAYLOAD_DATAstatic final int CC_INVALID_PAYLOAD_DATAInvalid frame payload data.- See Also:
 
- CC_POLICY_VIOLATIONstatic final int CC_POLICY_VIOLATIONPolicy Violation.- See Also:
 
- CC_MESSAGE_TOO_BIGstatic final int CC_MESSAGE_TOO_BIGMessage Too Big.- See Also:
 
- CC_MANDATORY_EXTstatic final int CC_MANDATORY_EXTMandatory Ext.- See Also:
 
- CC_INTERNAL_ERRORstatic final int CC_INTERNAL_ERRORInternal Error.- See Also:
 
- CC_SERVICE_RESTARTstatic final int CC_SERVICE_RESTARTService Restart.- See Also:
 
- CC_TRY_AGAIN_LATERstatic final int CC_TRY_AGAIN_LATERTry Again Later.- See Also:
 
- CC_TLS_HANDSHAKEstatic final int CC_TLS_HANDSHAKETLS handshake- See Also:
 
 
- Method Details- onCommOpenCalled when the communication link is opened.- Parameters:
- comm- The WebSocket communication instance.
 
- onCommConnectedCalled when the communication link is connected.- Parameters:
- comm- The WebSocket communication instance.
 
- onCommDataCalled when the communication link has received binary data.- Parameters:
- comm- The WebSocket communication instance.
- data- The data byte array.
- offset- Offset in buffer.
- len- Length of data.
 
- onCommDataCalled when the communication link has received String data.- Parameters:
- comm- The WebSocket communication instance.
- data- The String data.
 
- onCommHeartBeatCalled when a heart-beat frame is received.- Parameters:
- comm- The WebSocket communication instance.
- duration- Duration of the PING-PONG message exchange in nanoseconds.
 
- onCommTimeoutCalled when the communication link has timed out on a read or write operation.- Parameters:
- comm- The WebSocket communication instance.
- isReadTimeout- Flag indicating read timeout when true, false indicates write timeout.
 
- onCommErrorCalled when the communication link is closed.- Parameters:
- comm- The WebSocket communication instance.
- e- The exception.
 
- onCommClosingCalled when the communication link is closing.- Parameters:
- comm- The WebSocket communication instance.
 
- onCommClosedCalled when the communication link is closed.- Parameters:
- comm- The WebSocket communication instance.
- code- The reason code for closure.
- reason- The reason string explanation for closure.