public class DefaultSocketChannelConfig extends DefaultChannelConfig implements SocketChannelConfig
SocketChannelConfig
implementation.构造器和说明 |
---|
DefaultSocketChannelConfig(java.net.Socket socket)
Creates a new instance.
|
限定符和类型 | 方法和说明 |
---|---|
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 |
isKeepAlive()
Gets the
StandardSocketOptions.SO_KEEPALIVE option. |
boolean |
isReuseAddress()
Gets the
StandardSocketOptions.SO_REUSEADDR option. |
boolean |
isTcpNoDelay()
Gets the
StandardSocketOptions.TCP_NODELAY option. |
void |
setKeepAlive(boolean keepAlive)
Sets the
StandardSocketOptions.SO_KEEPALIVE option. |
boolean |
setOption(java.lang.String key,
java.lang.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)
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. |
getBufferFactory, getConnectTimeoutMillis, getPipelineFactory, setBufferFactory, setConnectTimeoutMillis, setOptions, setPipelineFactory
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getBufferFactory, getConnectTimeoutMillis, getPipelineFactory, setBufferFactory, setConnectTimeoutMillis, setOptions, setPipelineFactory
public DefaultSocketChannelConfig(java.net.Socket socket)
public boolean setOption(java.lang.String key, java.lang.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
在接口中 ChannelConfig
setOption
在类中 DefaultChannelConfig
true
if and only if the property has been setpublic int getReceiveBufferSize()
SocketChannelConfig
StandardSocketOptions.SO_RCVBUF
option.getReceiveBufferSize
在接口中 SocketChannelConfig
public int getSendBufferSize()
SocketChannelConfig
StandardSocketOptions.SO_SNDBUF
option.getSendBufferSize
在接口中 SocketChannelConfig
public int getSoLinger()
SocketChannelConfig
StandardSocketOptions.SO_LINGER
option.getSoLinger
在接口中 SocketChannelConfig
public int getTrafficClass()
SocketChannelConfig
StandardSocketOptions.IP_TOS
option.getTrafficClass
在接口中 SocketChannelConfig
public boolean isKeepAlive()
SocketChannelConfig
StandardSocketOptions.SO_KEEPALIVE
option.isKeepAlive
在接口中 SocketChannelConfig
public boolean isReuseAddress()
SocketChannelConfig
StandardSocketOptions.SO_REUSEADDR
option.isReuseAddress
在接口中 SocketChannelConfig
public boolean isTcpNoDelay()
SocketChannelConfig
StandardSocketOptions.TCP_NODELAY
option.isTcpNoDelay
在接口中 SocketChannelConfig
public void setKeepAlive(boolean keepAlive)
SocketChannelConfig
StandardSocketOptions.SO_KEEPALIVE
option.setKeepAlive
在接口中 SocketChannelConfig
public void setPerformancePreferences(int connectionTime, int latency, int bandwidth)
SocketChannelConfig
Socket.setPerformancePreferences(int, int, int)
.setPerformancePreferences
在接口中 SocketChannelConfig
public void setReceiveBufferSize(int receiveBufferSize)
SocketChannelConfig
StandardSocketOptions.SO_RCVBUF
option.setReceiveBufferSize
在接口中 SocketChannelConfig
public void setReuseAddress(boolean reuseAddress)
SocketChannelConfig
StandardSocketOptions.SO_REUSEADDR
option.setReuseAddress
在接口中 SocketChannelConfig
public void setSendBufferSize(int sendBufferSize)
SocketChannelConfig
StandardSocketOptions.SO_SNDBUF
option.setSendBufferSize
在接口中 SocketChannelConfig
public void setSoLinger(int soLinger)
SocketChannelConfig
StandardSocketOptions.SO_LINGER
option.setSoLinger
在接口中 SocketChannelConfig
public void setTcpNoDelay(boolean tcpNoDelay)
SocketChannelConfig
StandardSocketOptions.TCP_NODELAY
option.setTcpNoDelay
在接口中 SocketChannelConfig
public void setTrafficClass(int trafficClass)
SocketChannelConfig
StandardSocketOptions.IP_TOS
option.setTrafficClass
在接口中 SocketChannelConfig