Package com.sshtools.synergy.nio
Class ProtocolContext
java.lang.Object
com.sshtools.synergy.nio.ProtocolContext
- Direct Known Subclasses:
SshContext
A protocol context defines the behavior for a listening interface.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected intprotected booleanprotected intprotected boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract ProtocolEnginecreateEngine(ConnectRequestFuture connectFuture) Create a protocol engine.voidenableHTTPProxy(String proxyHostname, int proxyPort) voidenableHTTPProxy(String proxyHostname, int proxyPort, String proxyUsername, String proxyPassword) voidenableHTTPProxy(String proxyHostname, int proxyPort, String proxyUsername, String proxyPassword, String userAgent) voidenableHTTPProxy(String proxyHostname, int proxyPort, String proxyUsername, String proxyPassword, String userAgent, Map<String, String> optionalHeaders) voidenableSocks4Proxy(String proxyHostname, int proxyPort, String proxyUsername) voidenableSocks5Proxy(String proxyHostname, int proxyPort, String proxyUsername, String proxyPassword, boolean localLookup) intintGet the socket receive buffer size.intGet the socket send buffer size.booleanIndicates whether the SO_KEEPALIVE socket option is set on connected sockets.booleanIndicates whether the SO_REUSEADDR socket option will be set on a server socket.booleanIndicates whether the TCP_NODELAY socket option is set on connected sockets.booleanbooleanvoidsetReceiveBufferSize(int receiveBufferSize) Set the receive buffer size for sockets.voidsetSendBufferSize(int sendBufferSize) Set the send buffer size for sockets.voidsetSocketConnectionFactory(SocketConnectionFactory socketConnectionFactory) voidsetSocketOptionKeepAlive(boolean keepAlive) Set the SO_KEEPALIVE socket option on connected sockets.voidsetSocketOptionReuseAddress(boolean reuseAddress) Indicates whether the SO_REUSEADDR socket option will be set on a server socket.voidsetSocketOptionTcpNoDelay(boolean tcpNoDelay) Set the TCP_NODELAY socket option on connected sockets.abstract voidshutdown()
-
Field Details
-
keepAlive
protected boolean keepAlive -
tcpNoDelay
protected boolean tcpNoDelay -
reuseAddress
protected boolean reuseAddress -
receiveBufferSize
protected int receiveBufferSize -
sendBufferSize
protected int sendBufferSize
-
-
Constructor Details
-
ProtocolContext
public ProtocolContext()
-
-
Method Details
-
createEngine
protected abstract ProtocolEngine createEngine(ConnectRequestFuture connectFuture) throws IOException Create a protocol engine.- Returns:
- ProtocolEngine
- Throws:
IOException
-
getSocketOptionKeepAlive
public boolean getSocketOptionKeepAlive()Indicates whether the SO_KEEPALIVE socket option is set on connected sockets.- Returns:
- boolean
-
getSocketOptionReuseAddress
public boolean getSocketOptionReuseAddress()Indicates whether the SO_REUSEADDR socket option will be set on a server socket.- Returns:
- boolean
-
setSocketOptionReuseAddress
public void setSocketOptionReuseAddress(boolean reuseAddress) Indicates whether the SO_REUSEADDR socket option will be set on a server socket.- Parameters:
reuseAddress- boolean
-
setSocketOptionKeepAlive
public void setSocketOptionKeepAlive(boolean keepAlive) Set the SO_KEEPALIVE socket option on connected sockets.- Parameters:
keepAlive- boolean
-
getSocketOptionTcpNoDelay
public boolean getSocketOptionTcpNoDelay()Indicates whether the TCP_NODELAY socket option is set on connected sockets.- Returns:
- boolean
-
setSocketOptionTcpNoDelay
public void setSocketOptionTcpNoDelay(boolean tcpNoDelay) Set the TCP_NODELAY socket option on connected sockets.- Parameters:
tcpNoDelay- boolean
-
setReceiveBufferSize
public void setReceiveBufferSize(int receiveBufferSize) Set the receive buffer size for sockets.- Parameters:
receiveBufferSize- int
-
setSendBufferSize
public void setSendBufferSize(int sendBufferSize) Set the send buffer size for sockets.- Parameters:
sendBufferSize- int
-
getReceiveBufferSize
public int getReceiveBufferSize()Get the socket receive buffer size.- Returns:
- int
-
getSendBufferSize
public int getSendBufferSize()Get the socket send buffer size.- Returns:
- int
-
getSocketConnectionFactory
-
setSocketConnectionFactory
-
shutdown
public abstract void shutdown() -
enableSocks4Proxy
-
enableSocks5Proxy
-
enableHTTPProxy
-
enableHTTPProxy
-
enableHTTPProxy
-
enableHTTPProxy
-
isProxyEnabled
public boolean isProxyEnabled() -
getProxyHostname
-
getProxyPort
public int getProxyPort() -
getProxyUsername
-
getProxyPassword
-
isResolveLocally
public boolean isResolveLocally() -
getUserAgent
-
getOptionalHeaders
-
getProxyType
-