Package com.iizix.comm
Class WebSocketServerComm
java.lang.Object
com.iizix.comm.WebSocketServerComm
This class handles a Server Socket NIO implementation into a single-threaded Worker that accepts Socket connections in a non-blocking mode. When a socket connection is establishes to this server socket, it is assumed to have a HTTP header that matches the WebSocket protocol. All other HTTP requests are rejected.
- Author:
- Christopher Mindus
Nested Class Summary
Constructor Summary
ConstructorDescriptionWebSocketServerComm
(WebSocketServerCommProps properties, Worker worker, TransactionCommListener listener, WebSocketAcceptor acceptor) Constructs the WebSocket Server communication engine for the worker in question.WebSocketServerComm
(WebSocketServerCommProps properties, Worker worker, WebSocketCommListener listener, WebSocketAcceptor acceptor) Constructs the WebSocket Server communication engine for the worker in question.Method Summary
Constructor Details
WebSocketServerComm
public WebSocketServerComm(WebSocketServerCommProps properties, Worker worker, TransactionCommListener listener, WebSocketAcceptor acceptor) Constructs the WebSocket Server communication engine for the worker in question.WebSocketServerComm
public WebSocketServerComm(WebSocketServerCommProps properties, Worker worker, WebSocketCommListener listener, WebSocketAcceptor acceptor) Constructs the WebSocket Server communication engine for the worker in question.
Method Details
open
Opens the server socket with an unused port within the specified range.- Throws:
WebSocketException
- If the ServerSocket is already open, or if no socket was found available.
getState
Gets the state of the server socket.close
public boolean close()Closes this server socket.- Returns:
- true for successful close, false otherwise.