public abstract class AbstractWebSocket extends WebSocketAdapter
Constructor and Description |
---|
AbstractWebSocket() |
Modifier and Type | Method and Description |
---|---|
int |
getConnectionLostTimeout()
Get the interval checking for lost connections
Default is 60 seconds
|
protected abstract Collection<WebSocket> |
getConnections()
Getter to get all the currently available connections
|
boolean |
isReuseAddr()
Tests Tests if SO_REUSEADDR is enabled.
|
boolean |
isTcpNoDelay()
Tests if TCP_NODELAY is enabled.
|
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
|
void |
setReuseAddr(boolean reuseAddr)
Setter for soReuseAddr
Enable/disable SO_REUSEADDR for the socket
|
void |
setTcpNoDelay(boolean tcpNoDelay)
Setter for tcpNoDelay
Enable/disable TCP_NODELAY (disable/enable Nagle's algorithm) for new connections
|
protected void |
startConnectionLostTimer()
Start the connection lost timer
|
protected void |
stopConnectionLostTimer()
Stop the connection lost timer
|
onPreparePing, onWebsocketHandshakeReceivedAsClient, onWebsocketHandshakeReceivedAsServer, onWebsocketHandshakeSentAsClient, onWebsocketPing, onWebsocketPong
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getLocalSocketAddress, getRemoteSocketAddress, onWebsocketClose, onWebsocketCloseInitiated, onWebsocketClosing, onWebsocketError, onWebsocketMessage, onWebsocketMessage, onWebsocketOpen, onWriteDemand
public int getConnectionLostTimeout()
public void setConnectionLostTimeout(int connectionLostTimeout)
connectionLostTimeout
- the interval in secondsprotected void stopConnectionLostTimer()
protected void startConnectionLostTimer()
protected abstract Collection<WebSocket> getConnections()
public boolean isTcpNoDelay()
public void setTcpNoDelay(boolean tcpNoDelay)
Enable/disable TCP_NODELAY (disable/enable Nagle's algorithm) for new connections
tcpNoDelay
- true to enable TCP_NODELAY, false to disable.public boolean isReuseAddr()
public void setReuseAddr(boolean reuseAddr)
Enable/disable SO_REUSEADDR for the socket
reuseAddr
- whether to enable or disable SO_REUSEADDRCopyright © 2020. All rights reserved.