public interface SocketChannelConfig extends ChannelConfig
ChannelConfig for a SocketChannel.
ChannelConfig,
SocketChannelConfig allows the following options in the option map:
| Name | Associated setter method |
|---|---|
"keepAlive" | setKeepAlive(boolean) |
"reuseAddress" | setReuseAddress(boolean) |
"soLinger" | setSoLinger(int) |
"tcpNoDelay" | setTcpNoDelay(boolean) |
"receiveBufferSize" | setReceiveBufferSize(int) |
"sendBufferSize" | setSendBufferSize(int) |
"trafficClass" | setTrafficClass(int) |
| Modifier and Type | Method and Description |
|---|---|
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. |
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, getOption, getOptions, getWriteSpinCount, setConnectTimeoutMillis, setOption, setOptions, setWriteSpinCountboolean isTcpNoDelay()
StandardSocketOptions.TCP_NODELAY option.void setTcpNoDelay(boolean tcpNoDelay)
StandardSocketOptions.TCP_NODELAY option.int getSoLinger()
StandardSocketOptions.SO_LINGER option.void setSoLinger(int soLinger)
StandardSocketOptions.SO_LINGER option.int getSendBufferSize()
StandardSocketOptions.SO_SNDBUF option.void setSendBufferSize(int sendBufferSize)
StandardSocketOptions.SO_SNDBUF option.int getReceiveBufferSize()
StandardSocketOptions.SO_RCVBUF option.void setReceiveBufferSize(int receiveBufferSize)
StandardSocketOptions.SO_RCVBUF option.boolean isKeepAlive()
StandardSocketOptions.SO_KEEPALIVE option.void setKeepAlive(boolean keepAlive)
StandardSocketOptions.SO_KEEPALIVE option.int getTrafficClass()
StandardSocketOptions.IP_TOS option.void setTrafficClass(int trafficClass)
StandardSocketOptions.IP_TOS option.boolean isReuseAddress()
StandardSocketOptions.SO_REUSEADDR option.void setReuseAddress(boolean reuseAddress)
StandardSocketOptions.SO_REUSEADDR option.void setPerformancePreferences(int connectionTime,
int latency,
int bandwidth)
Socket.setPerformancePreferences(int, int, int).boolean isAllowHalfClosure()
true 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.void setAllowHalfClosure(boolean allowHalfClosure)
true 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.Copyright © 2008-2012 The Netty Project. All Rights Reserved.