
public class DefaultSocketChannelConfig extends DefaultChannelConfig implements SocketChannelConfig
SocketChannelConfig implementation.| Constructor and Description |
|---|
DefaultSocketChannelConfig(Socket socket)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getReceiveBufferSize()
Gets the
SO_RCVBUF option. |
int |
getSendBufferSize()
Gets the
SO_SNDBUF option. |
int |
getSoLinger()
Gets the
SO_LINGER option. |
int |
getTrafficClass()
Gets the traffic class.
|
boolean |
isKeepAlive()
Gets the
SO_KEEPALIVE option. |
boolean |
isReuseAddress()
Gets the
SO_REUSEADDR option. |
boolean |
isTcpNoDelay()
Gets the
SO_TCPNODELAY option. |
void |
setKeepAlive(boolean keepAlive)
Sets the
SO_KEEPALIVE option. |
boolean |
setOption(String key,
Object value)
Sets a configuration property with the specified name and value.
|
void |
setPerformancePreferences(int connectionTime,
int latency,
int bandwidth)
Sets the performance preferences as specified in
Socket.setPerformancePreferences(int, int, int). |
void |
setReceiveBufferSize(int receiveBufferSize)
Gets the
SO_RCVBUF option. |
void |
setReuseAddress(boolean reuseAddress)
Sets the
SO_REUSEADDR option. |
void |
setSendBufferSize(int sendBufferSize)
Sets the
SO_SNDBUF option. |
void |
setSoLinger(int soLinger)
Sets the
SO_LINGER option. |
void |
setTcpNoDelay(boolean tcpNoDelay)
Sets the
SO_TCPNODELAY option. |
void |
setTrafficClass(int trafficClass)
Sets the traffic class as specified in
Socket.setTrafficClass(int). |
getBufferFactory, getConnectTimeoutMillis, getPipelineFactory, getWriteTimeoutMillis, setBufferFactory, setConnectTimeoutMillis, setOptions, setPipelineFactory, setWriteTimeoutMillisclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetBufferFactory, getConnectTimeoutMillis, getPipelineFactory, getWriteTimeoutMillis, setBufferFactory, setConnectTimeoutMillis, setOptions, setPipelineFactory, setWriteTimeoutMillispublic DefaultSocketChannelConfig(Socket socket)
public boolean setOption(String key, Object value)
ChannelConfig
public boolean setOption(String name, Object value) {
if (super.setOption(name, value)) {
return true;
}
if (name.equals("additionalOption")) {
....
return true;
}
return false;
}
setOption in interface ChannelConfigsetOption in class DefaultChannelConfigtrue if and only if the property has been setpublic int getReceiveBufferSize()
SocketChannelConfigSO_RCVBUF option.getReceiveBufferSize in interface SocketChannelConfigpublic int getSendBufferSize()
SocketChannelConfigSO_SNDBUF option.getSendBufferSize in interface SocketChannelConfigpublic int getSoLinger()
SocketChannelConfigSO_LINGER option.getSoLinger in interface SocketChannelConfigpublic int getTrafficClass()
SocketChannelConfiggetTrafficClass in interface SocketChannelConfigpublic boolean isKeepAlive()
SocketChannelConfigSO_KEEPALIVE option.isKeepAlive in interface SocketChannelConfigpublic boolean isReuseAddress()
SocketChannelConfigSO_REUSEADDR option.isReuseAddress in interface SocketChannelConfigpublic boolean isTcpNoDelay()
SocketChannelConfigSO_TCPNODELAY option.isTcpNoDelay in interface SocketChannelConfigpublic void setKeepAlive(boolean keepAlive)
SocketChannelConfigSO_KEEPALIVE option.setKeepAlive in interface SocketChannelConfigpublic void setPerformancePreferences(int connectionTime,
int latency,
int bandwidth)
SocketChannelConfigSocket.setPerformancePreferences(int, int, int).setPerformancePreferences in interface SocketChannelConfigpublic void setReceiveBufferSize(int receiveBufferSize)
SocketChannelConfigSO_RCVBUF option.setReceiveBufferSize in interface SocketChannelConfigpublic void setReuseAddress(boolean reuseAddress)
SocketChannelConfigSO_REUSEADDR option.setReuseAddress in interface SocketChannelConfigpublic void setSendBufferSize(int sendBufferSize)
SocketChannelConfigSO_SNDBUF option.setSendBufferSize in interface SocketChannelConfigpublic void setSoLinger(int soLinger)
SocketChannelConfigSO_LINGER option.setSoLinger in interface SocketChannelConfigpublic void setTcpNoDelay(boolean tcpNoDelay)
SocketChannelConfigSO_TCPNODELAY option.setTcpNoDelay in interface SocketChannelConfigpublic void setTrafficClass(int trafficClass)
SocketChannelConfigSocket.setTrafficClass(int).setTrafficClass in interface SocketChannelConfigCopyright © 2008-2013 JBoss, by Red Hat. All Rights Reserved.