| Modifier and Type | Field and Description |
|---|---|
| private ScheduledFuture | connectionLostCheckerFuture
Attribute for a task that checks for lost connections |
| private ScheduledExecutorService | connectionLostCheckerService
Attribute for a service that triggers lost connection checking |
| private long | connectionLostTimeout
Attribute for the lost connection check interval in nanoseconds |
| private boolean | daemon
Attribute to start internal threads as daemon |
| protected static int | DEFAULT_READ_BUFFER_SIZE
Used for internal buffer allocations when the socket buffer size is not specified. |
| private final Logger | log
Logger instance |
| private int | receiveBufferSize
TCP receive buffer size that will be used for sockets (zero means use system default) |
| private boolean | reuseAddr
Attribute which allows you to enable/disable the SO_REUSEADDR socket option. |
| private final Object | syncConnectionLost
Attribute to sync on |
| private boolean | tcpNoDelay
Attribute which allows you to deactivate the Nagle's algorithm |
| private boolean | websocketRunning
Attribute to keep track if the WebSocket Server/Client is running/connected |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| private void | executeConnectionLostDetection(WebSocket
the websocket instance webSocket, long the lowest/oldest allowable last pong time (in nanoTime) before we
consider the connection to be lost minimumPongTime)Send a ping to the endpoint or close the connection since the other endpoint did not respond with a ping |
| public int | Returns: the interval in secondsGet the interval checking for lost connections Default is 60 seconds |
| protected abstract Collection | Returns: the currently available connectionsGetter to get all the currently available connections |
| public int | getReceiveBufferSize()
Returns the TCP receive buffer size that will be used for sockets (or zero, if not explicitly set). |
| public boolean | |
| public boolean | Returns: a boolean indicating whether or not SO_REUSEADDR is enabled.Tests Tests if SO_REUSEADDR is enabled. |
| public boolean | Returns: a boolean indicating whether or not TCP_NODELAY is enabled for new connections.Tests if TCP_NODELAY is enabled. |
| private void | restartConnectionLostTimer()
This methods allows the reset of the connection lost timer in case of a changed parameter |
| public void | setConnectionLostTimeout(int
the interval in seconds connectionLostTimeout)Setter for the interval checking for lost connections A value lower or equal 0 results in the check to be deactivated |
| public void | setDaemon(boolean daemon)
Setter for daemon Controls whether or not internal threads are spawned in daemon mode |
| public void | setReceiveBufferSize(int receiveBufferSize)
Sets the TCP receive buffer size that will be used for sockets. |
| public void | setReuseAddr(boolean
whether to enable or disable SO_REUSEADDR reuseAddr)Setter for soReuseAddr Enable/disable SO_REUSEADDR for the socket |
| public void | setTcpNoDelay(boolean
true to enable TCP_NODELAY, false to disable. tcpNoDelay)Setter for tcpNoDelay Enable/disable TCP_NODELAY (disable/enable Nagle's algorithm) for new connections |
| protected void | |
| protected void |
| connectionLostCheckerFuture | back to summary |
|---|---|
| private ScheduledFuture<?> connectionLostCheckerFuture Attribute for a task that checks for lost connections
| |
| connectionLostCheckerService | back to summary |
|---|---|
| private ScheduledExecutorService connectionLostCheckerService Attribute for a service that triggers lost connection checking
| |
| connectionLostTimeout | back to summary |
|---|---|
| private long connectionLostTimeout Attribute for the lost connection check interval in nanoseconds
| |
| daemon | back to summary |
|---|---|
| private boolean daemon Attribute to start internal threads as daemon
| |
| DEFAULT_READ_BUFFER_SIZE | back to summary |
|---|---|
| protected static int DEFAULT_READ_BUFFER_SIZE Used for internal buffer allocations when the socket buffer size is not specified. | |
| log | back to summary |
|---|---|
| private final Logger log Logger instance
| |
| receiveBufferSize | back to summary |
|---|---|
| private int receiveBufferSize TCP receive buffer size that will be used for sockets (zero means use system default)
| |
| reuseAddr | back to summary |
|---|---|
| private boolean reuseAddr Attribute which allows you to enable/disable the SO_REUSEADDR socket option.
| |
| syncConnectionLost | back to summary |
|---|---|
| private final Object syncConnectionLost Attribute to sync on | |
| tcpNoDelay | back to summary |
|---|---|
| private boolean tcpNoDelay Attribute which allows you to deactivate the Nagle's algorithm
| |
| websocketRunning | back to summary |
|---|---|
| private boolean websocketRunning Attribute to keep track if the WebSocket Server/Client is running/connected
| |
| AbstractWebSocket | back to summary |
|---|---|
| public AbstractWebSocket() | |
| cancelConnectionLostTimer | back to summary |
|---|---|
| private void cancelConnectionLostTimer() Cancel any running timer for the connection lost detection
| |
| executeConnectionLostDetection | back to summary |
|---|---|
| private void executeConnectionLostDetection(WebSocket webSocket, long minimumPongTime) Send a ping to the endpoint or close the connection since the other endpoint did not respond with a ping
| |
| getConnectionLostTimeout | back to summary |
|---|---|
| public int getConnectionLostTimeout() Get the interval checking for lost connections Default is 60 seconds
| |
| getConnections | back to summary |
|---|---|
| protected abstract Collection Getter to get all the currently available connections
| |
| getReceiveBufferSize | back to summary |
|---|---|
| public int getReceiveBufferSize() Returns the TCP receive buffer size that will be used for sockets (or zero, if not explicitly set).
| |
| isDaemon | back to summary |
|---|---|
| public boolean isDaemon() Getter for daemon
| |
| isReuseAddr | back to summary |
|---|---|
| public boolean isReuseAddr() Tests Tests if SO_REUSEADDR is enabled.
| |
| isTcpNoDelay | back to summary |
|---|---|
| public boolean isTcpNoDelay() Tests if TCP_NODELAY is enabled.
| |
| restartConnectionLostTimer | back to summary |
|---|---|
| private void restartConnectionLostTimer() This methods allows the reset of the connection lost timer in case of a changed parameter
| |
| setConnectionLostTimeout | back to summary |
|---|---|
| public void setConnectionLostTimeout(int connectionLostTimeout) Setter for the interval checking for lost connections A value lower or equal 0 results in the check to be deactivated
| |
| setDaemon | back to summary |
|---|---|
| public void setDaemon(boolean daemon) Setter for daemon Controls whether or not internal threads are spawned in daemon mode
| |
| setReceiveBufferSize | back to summary |
|---|---|
| public void setReceiveBufferSize(int receiveBufferSize) Sets the TCP receive buffer size that will be used for sockets. If this is not explicitly set (or set to zero), the system default is used.
| |
| setReuseAddr | back to summary |
|---|---|
| public void setReuseAddr(boolean reuseAddr) Setter for soReuseAddr Enable/disable SO_REUSEADDR for the socket
| |
| setTcpNoDelay | back to summary |
|---|---|
| public void setTcpNoDelay(boolean tcpNoDelay) Setter for tcpNoDelay Enable/disable TCP_NODELAY (disable/enable Nagle's algorithm) for new connections
| |
| startConnectionLostTimer | back to summary |
|---|---|
| protected void startConnectionLostTimer() Start the connection lost timer
| |
| stopConnectionLostTimer | back to summary |
|---|---|
| protected void stopConnectionLostTimer() Stop the connection lost timer
| |