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, setPipelineFactoryclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetBufferFactory, getConnectTimeoutMillis, getPipelineFactory, setBufferFactory, setConnectTimeoutMillis, setOptions, setPipelineFactorypublic 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 在接口中 ChannelConfigsetOption 在类中 DefaultChannelConfigtrue if and only if the property has been setpublic int getReceiveBufferSize()
SocketChannelConfigStandardSocketOptions.SO_RCVBUF option.getReceiveBufferSize 在接口中 SocketChannelConfigpublic int getSendBufferSize()
SocketChannelConfigStandardSocketOptions.SO_SNDBUF option.getSendBufferSize 在接口中 SocketChannelConfigpublic int getSoLinger()
SocketChannelConfigStandardSocketOptions.SO_LINGER option.getSoLinger 在接口中 SocketChannelConfigpublic int getTrafficClass()
SocketChannelConfigStandardSocketOptions.IP_TOS option.getTrafficClass 在接口中 SocketChannelConfigpublic boolean isKeepAlive()
SocketChannelConfigStandardSocketOptions.SO_KEEPALIVE option.isKeepAlive 在接口中 SocketChannelConfigpublic boolean isReuseAddress()
SocketChannelConfigStandardSocketOptions.SO_REUSEADDR option.isReuseAddress 在接口中 SocketChannelConfigpublic boolean isTcpNoDelay()
SocketChannelConfigStandardSocketOptions.TCP_NODELAY option.isTcpNoDelay 在接口中 SocketChannelConfigpublic void setKeepAlive(boolean keepAlive)
SocketChannelConfigStandardSocketOptions.SO_KEEPALIVE option.setKeepAlive 在接口中 SocketChannelConfigpublic void setPerformancePreferences(int connectionTime,
int latency,
int bandwidth)
SocketChannelConfigSocket.setPerformancePreferences(int, int, int).setPerformancePreferences 在接口中 SocketChannelConfigpublic void setReceiveBufferSize(int receiveBufferSize)
SocketChannelConfigStandardSocketOptions.SO_RCVBUF option.setReceiveBufferSize 在接口中 SocketChannelConfigpublic void setReuseAddress(boolean reuseAddress)
SocketChannelConfigStandardSocketOptions.SO_REUSEADDR option.setReuseAddress 在接口中 SocketChannelConfigpublic void setSendBufferSize(int sendBufferSize)
SocketChannelConfigStandardSocketOptions.SO_SNDBUF option.setSendBufferSize 在接口中 SocketChannelConfigpublic void setSoLinger(int soLinger)
SocketChannelConfigStandardSocketOptions.SO_LINGER option.setSoLinger 在接口中 SocketChannelConfigpublic void setTcpNoDelay(boolean tcpNoDelay)
SocketChannelConfigStandardSocketOptions.TCP_NODELAY option.setTcpNoDelay 在接口中 SocketChannelConfigpublic void setTrafficClass(int trafficClass)
SocketChannelConfigStandardSocketOptions.IP_TOS option.setTrafficClass 在接口中 SocketChannelConfig