public class WebSocketComm extends WebSocketCommNIO
The WebSocket Client pure socket implementation. This implementation is based on RFC 6455 "The WebSocket Protocol", also supporting the older "draft-ietf-hybi-thewebsocketprotocol-00" also called "Hixie 75/76" versions.
The WebSocket Protocol enables two-way communication between a client running untrusted code in a controlled environment to a remote host that has opted-in to communications from that code. The security model used for this is the origin-based security model commonly used by web browsers. The protocol consists of an opening handshake followed by basic message framing, layered over TCP. The goal of this technology is to provide a mechanism for browser-based applications that need two-way communication with servers that does not rely on opening multiple HTTP connections (e.g., using XMLHttpRequest or <iframe>s and long polling).
To be implemented (fragmentation compliance with RFC 6455).
Modifier and Type | Field and Description |
---|---|
WebSocketCommProps |
properties
The WebSocket (and Socket) properties.
|
requestURI
Constructor and Description |
---|
WebSocketComm(WebSocketCommProps properties,
Worker worker,
SocketChannel channel,
WebSocketCommListener listener,
WebSocketAcceptor acceptor)
Creates a new WebSocket Client Communication channel from an accepted socket connection and sets it to as CHECKING_CONNECT_REQUEST,
before the negotiation is completed and then becomes CONNECTED.
|
WebSocketComm(WebSocketCommProps properties,
Worker worker,
WebSocketCommListener listener,
SSLEngine engine)
Creates a new WebSocket Client Communication channel as UNINITIALIZED.
|
areBinaryDataFramesSupported, close, close, close, decodeBase64, encodeBase64, encodeBase64, getAttachment, getDomain, getPort, getRemoteAddr, getRemoteHost, getSocketAddress, getState, getSubProtocol, isClosed, isClosing, isConnected, isConnecting, isSecure, open, open, send, send, sendHeartBeat, serverInitializeComm, setAttachment, setSubProtocol
public final WebSocketCommProps properties
public WebSocketComm(WebSocketCommProps properties, Worker worker, WebSocketCommListener listener, SSLEngine engine) throws IOException
properties
- The WebSocket properties.worker
- The worker thread for socket processing.listener
- The listener for WebSocket events.engine
- The SSL engine or null for plain connection.IOException
- For SSL errors.public WebSocketComm(WebSocketCommProps properties, Worker worker, SocketChannel channel, WebSocketCommListener listener, WebSocketAcceptor acceptor) throws IOException
properties
- The WebSocket properties.worker
- The worker thread for socket processing.channel
- The SocketChannel instance that has been accepted.listener
- The listener for WebSocket (server) events.acceptor
- The URI acceptor for WebSocket requests.IOException
- For I/O exceptions.iizi® is a registered trademark of Mindus SARL. © Copyright 2019 Mindus SARL. All rights reserved.