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 |
|---|---|
<T> T |
getOption(ChannelOption<T> option)
Return the value of the given
ChannelOption |
Map<ChannelOption<?>,Object> |
getOptions()
Return all set
ChannelOption's. |
int |
getReceiveBufferSize()
Gets the
StandardSocketOptions.SO_RCVBUF option. |
int |
getSendBufferSize()
Gets the
StandardSocketOptions.SO_SNDBUF option. |
int |
getSoLinger()
Gets the
StandardSocketOptions.SO_LINGER option. |
int |
getTrafficClass()
Gets the
StandardSocketOptions.IP_TOS option. |
boolean |
isAllowHalfClosure()
Returns
true if and only if the channel should not close itself when its remote
peer shuts down output to make the connection half-closed. |
boolean |
isKeepAlive()
Gets the
StandardSocketOptions.SO_KEEPALIVE option. |
boolean |
isReuseAddress()
Gets the
StandardSocketOptions.SO_REUSEADDR option. |
boolean |
isTcpNoDelay()
Gets the
StandardSocketOptions.TCP_NODELAY option. |
void |
setAllowHalfClosure(boolean allowHalfClosure)
Sets whether the channel should not close itself when its remote peer shuts down output to
make the connection half-closed.
|
void |
setKeepAlive(boolean keepAlive)
Sets the
StandardSocketOptions.SO_KEEPALIVE option. |
<T> boolean |
setOption(ChannelOption<T> option,
T 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)
Sets the
StandardSocketOptions.SO_RCVBUF option. |
void |
setReuseAddress(boolean reuseAddress)
Sets the
StandardSocketOptions.SO_REUSEADDR option. |
void |
setSendBufferSize(int sendBufferSize)
Sets the
StandardSocketOptions.SO_SNDBUF option. |
void |
setSoLinger(int soLinger)
Sets the
StandardSocketOptions.SO_LINGER option. |
void |
setTcpNoDelay(boolean tcpNoDelay)
Sets the
StandardSocketOptions.TCP_NODELAY option. |
void |
setTrafficClass(int trafficClass)
Sets the
StandardSocketOptions.IP_TOS option. |
getConnectTimeoutMillis, getOptions, getWriteSpinCount, setConnectTimeoutMillis, setOptions, setWriteSpinCount, validateclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetConnectTimeoutMillis, getWriteSpinCount, setConnectTimeoutMillis, setOptions, setWriteSpinCountpublic DefaultSocketChannelConfig(Socket socket)
public Map<ChannelOption<?>,Object> getOptions()
ChannelConfigChannelOption's.getOptions in interface ChannelConfiggetOptions in class DefaultChannelConfigpublic <T> T getOption(ChannelOption<T> option)
ChannelConfigChannelOptiongetOption in interface ChannelConfiggetOption in class DefaultChannelConfigpublic <T> boolean setOption(ChannelOption<T> option, T 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()
SocketChannelConfigStandardSocketOptions.SO_RCVBUF option.getReceiveBufferSize in interface SocketChannelConfigpublic int getSendBufferSize()
SocketChannelConfigStandardSocketOptions.SO_SNDBUF option.getSendBufferSize in interface SocketChannelConfigpublic int getSoLinger()
SocketChannelConfigStandardSocketOptions.SO_LINGER option.getSoLinger in interface SocketChannelConfigpublic int getTrafficClass()
SocketChannelConfigStandardSocketOptions.IP_TOS option.getTrafficClass in interface SocketChannelConfigpublic boolean isKeepAlive()
SocketChannelConfigStandardSocketOptions.SO_KEEPALIVE option.isKeepAlive in interface SocketChannelConfigpublic boolean isReuseAddress()
SocketChannelConfigStandardSocketOptions.SO_REUSEADDR option.isReuseAddress in interface SocketChannelConfigpublic boolean isTcpNoDelay()
SocketChannelConfigStandardSocketOptions.TCP_NODELAY option.isTcpNoDelay in interface SocketChannelConfigpublic void setKeepAlive(boolean keepAlive)
SocketChannelConfigStandardSocketOptions.SO_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)
SocketChannelConfigStandardSocketOptions.SO_RCVBUF option.setReceiveBufferSize in interface SocketChannelConfigpublic void setReuseAddress(boolean reuseAddress)
SocketChannelConfigStandardSocketOptions.SO_REUSEADDR option.setReuseAddress in interface SocketChannelConfigpublic void setSendBufferSize(int sendBufferSize)
SocketChannelConfigStandardSocketOptions.SO_SNDBUF option.setSendBufferSize in interface SocketChannelConfigpublic void setSoLinger(int soLinger)
SocketChannelConfigStandardSocketOptions.SO_LINGER option.setSoLinger in interface SocketChannelConfigpublic void setTcpNoDelay(boolean tcpNoDelay)
SocketChannelConfigStandardSocketOptions.TCP_NODELAY option.setTcpNoDelay in interface SocketChannelConfigpublic void setTrafficClass(int trafficClass)
SocketChannelConfigStandardSocketOptions.IP_TOS option.setTrafficClass in interface SocketChannelConfigpublic boolean isAllowHalfClosure()
SocketChannelConfigtrue if and only if the channel should not close itself when its remote
peer shuts down output to make the connection half-closed. If false, the connection
is closed automatically when the remote peer shuts down output.isAllowHalfClosure in interface SocketChannelConfigpublic void setAllowHalfClosure(boolean allowHalfClosure)
SocketChannelConfigtrue the connection is not closed when the
remote peer shuts down output. Instead, ChannelHandler.userEventTriggered(ChannelHandlerContext, Object)
is invoked with a ChannelInputShutdownEvent object. If false, the connection
is closed automatically.setAllowHalfClosure in interface SocketChannelConfigCopyright © 2008-2012 The Netty Project. All Rights Reserved.