public class DefaultOioSocketChannelConfig extends DefaultSocketChannelConfig implements OioSocketChannelConfig
javaSocketchannel| Constructor and Description |
|---|
DefaultOioSocketChannelConfig(SocketChannel channel, java.net.Socket javaSocket)
已过时。
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
autoReadCleared()
|
<T> T |
getOption(ChannelOption<T> option)
返回给定的 ChannelOption的值
|
java.util.Map<ChannelOption<?>,java.lang.Object> |
getOptions()
返回所有设置 ChannelOption的。
|
int |
getSoTimeout()
返回底层套接字上的操作可能阻止的最大时间。
|
OioSocketChannelConfig |
setAllocator(ByteBufAllocator allocator)
设置用于通道分配缓冲区的 ByteBufAllocator 。
|
OioSocketChannelConfig |
setAllowHalfClosure(boolean allowHalfClosure)
设置当远程对等关闭输出以使连接半关闭时,通道是否应该关闭。
|
OioSocketChannelConfig |
setAutoClose(boolean autoClose) |
OioSocketChannelConfig |
setAutoRead(boolean autoRead)
设置是否自动调用
ChannelHandlerContext.read(),以便用户应用程序根本不需要调用它。
|
OioSocketChannelConfig |
setConnectTimeoutMillis(int connectTimeoutMillis)
以毫秒为单位设置通道的连接超时。
|
OioSocketChannelConfig |
setKeepAlive(boolean keepAlive)
设置
StandardSocketOptions.SO_KEEPALIVE选项。
|
OioSocketChannelConfig |
setMaxMessagesPerRead(int maxMessagesPerRead)
已过时。
|
OioSocketChannelConfig |
setMessageSizeEstimator(MessageSizeEstimator estimator)
设置用于通道的 MessageSizeEstimator以检测消息的大小。
|
<T> boolean |
setOption(ChannelOption<T> option, T value)
使用指定的名称和值设置配置属性。
|
OioSocketChannelConfig |
setPerformancePreferences(int connectionTime, int latency, int bandwidth)
设置
Socket.setPerformancePreferences(int, int, int)指定的性能首选项。
|
OioSocketChannelConfig |
setReceiveBufferSize(int receiveBufferSize)
设置
StandardSocketOptions.SO_RCVBUF选项。
|
OioSocketChannelConfig |
setRecvByteBufAllocator(RecvByteBufAllocator allocator)
设置用于通道分配接收缓冲区的 RecvByteBufAllocator 。
|
OioSocketChannelConfig |
setReuseAddress(boolean reuseAddress)
设置
StandardSocketOptions.SO_REUSEADDR选项。
|
OioSocketChannelConfig |
setSendBufferSize(int sendBufferSize)
设置
StandardSocketOptions.SO_SNDBUF选项。
|
OioSocketChannelConfig |
setSoLinger(int soLinger)
设置
StandardSocketOptions.SO_LINGER选项。
|
OioSocketChannelConfig |
setSoTimeout(int timeout)
设置底层套接字上的操作可能会阻止的最大时间。
|
OioSocketChannelConfig |
setTcpNoDelay(boolean tcpNoDelay)
设置
StandardSocketOptions.TCP_NODELAY选项。
|
OioSocketChannelConfig |
setTrafficClass(int trafficClass)
设置
StandardSocketOptions.IP_TOS选项。
|
OioSocketChannelConfig |
setWriteBufferHighWaterMark(int writeBufferHighWaterMark)
设置写入缓冲区的高位标记。
|
OioSocketChannelConfig |
setWriteBufferLowWaterMark(int writeBufferLowWaterMark)
设置写入缓冲区的低水位标志。
|
OioSocketChannelConfig |
setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark)
设置 WriteBufferWaterMark用于设置写入缓冲区的高位和低位水印。
|
OioSocketChannelConfig |
setWriteSpinCount(int writeSpinCount)
设置写操作的最大循环计数,直到
WritableByteChannel.write(ByteBuffer)返回非零值。
|
getReceiveBufferSize, getSendBufferSize, getSoLinger, getTrafficClass, isAllowHalfClosure, isKeepAlive, isReuseAddress, isTcpNoDelaygetAllocator, getConnectTimeoutMillis, getMaxMessagesPerRead, getMessageSizeEstimator, getOptions, getRecvByteBufAllocator, getWriteBufferHighWaterMark, getWriteBufferLowWaterMark, getWriteBufferWaterMark, getWriteSpinCount, isAutoClose, isAutoRead, setOptions, validateclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetReceiveBufferSize, getSendBufferSize, getSoLinger, getTrafficClass, isAllowHalfClosure, isKeepAlive, isReuseAddress, isTcpNoDelaygetAllocator, getConnectTimeoutMillis, getMaxMessagesPerRead, getMessageSizeEstimator, getRecvByteBufAllocator, getWriteBufferHighWaterMark, getWriteBufferLowWaterMark, getWriteBufferWaterMark, getWriteSpinCount, isAutoClose, isAutoRead, setOptions@Deprecated public DefaultOioSocketChannelConfig(SocketChannel channel, java.net.Socket javaSocket)
public java.util.Map<ChannelOption<?>,java.lang.Object> getOptions()
ChannelConfig
ChannelOption的。
getOptions在界面
ChannelConfig
getOptions在课堂上
DefaultSocketChannelConfig
public <T> T getOption(ChannelOption<T> option)
ChannelConfig
ChannelOption的值
getOption ,界面
ChannelConfig
getOption在课堂
DefaultSocketChannelConfig
public <T> boolean setOption(ChannelOption<T> option, T value)
ChannelConfig复制的描述
public boolean setOption(ChannelOption<T> option, T value) {
if (super.setOption(option, value)) {
return true;
}
if (option.equals(additionalOption)) {
....
return true;
}
return false;
}
setOption在界面
ChannelConfig
setOption在课堂
DefaultSocketChannelConfig
true当且仅当该属性已设置
public OioSocketChannelConfig setSoTimeout(int timeout)
OioSocketChannelConfig
setSoTimeout在界面
OioSocketChannelConfig
public int getSoTimeout()
OioSocketChannelConfig复制的描述
getSoTimeout在界面
OioSocketChannelConfig
public OioSocketChannelConfig setTcpNoDelay(boolean tcpNoDelay)
SocketChannelConfig复制的描述
StandardSocketOptions.TCP_NODELAY选项。
请注意,这个选项的默认值是true不同于操作系统默认( false )。
但是,对于一些有问题的平台,例如Android,在Nagle算法禁用时显示不稳定的行为,默认值仍然为false 。
setTcpNoDelay在界面
OioSocketChannelConfig
setTcpNoDelay在界面
SocketChannelConfig
setTcpNoDelay在课堂上
DefaultSocketChannelConfig
public OioSocketChannelConfig setSoLinger(int soLinger)
SocketChannelConfig
StandardSocketOptions.SO_LINGER选项。
setSoLinger在界面
OioSocketChannelConfig
setSoLinger在界面
SocketChannelConfig
setSoLinger在课堂
DefaultSocketChannelConfig
public OioSocketChannelConfig setSendBufferSize(int sendBufferSize)
SocketChannelConfig
StandardSocketOptions.SO_SNDBUF选项。
setSendBufferSize在界面
OioSocketChannelConfig
setSendBufferSize在界面
SocketChannelConfig
setSendBufferSize在课堂
DefaultSocketChannelConfig
public OioSocketChannelConfig setReceiveBufferSize(int receiveBufferSize)
SocketChannelConfig
StandardSocketOptions.SO_RCVBUF选项。
setReceiveBufferSize在界面
OioSocketChannelConfig
setReceiveBufferSize在界面
SocketChannelConfig
setReceiveBufferSize在课堂上
DefaultSocketChannelConfig
public OioSocketChannelConfig setKeepAlive(boolean keepAlive)
SocketChannelConfig
StandardSocketOptions.SO_KEEPALIVE选项。
setKeepAlive在界面
OioSocketChannelConfig
setKeepAlive在界面
SocketChannelConfig
setKeepAlive在课堂
DefaultSocketChannelConfig
public OioSocketChannelConfig setTrafficClass(int trafficClass)
SocketChannelConfig
StandardSocketOptions.IP_TOS选项。
setTrafficClass在界面
OioSocketChannelConfig
setTrafficClass ,界面
SocketChannelConfig
setTrafficClass在课堂上
DefaultSocketChannelConfig
public OioSocketChannelConfig setReuseAddress(boolean reuseAddress)
SocketChannelConfig
StandardSocketOptions.SO_REUSEADDR选项。
setReuseAddress在界面
OioSocketChannelConfig
setReuseAddress在界面
SocketChannelConfig
setReuseAddress在课堂
DefaultSocketChannelConfig
public OioSocketChannelConfig setPerformancePreferences(int connectionTime, int latency, int bandwidth)
SocketChannelConfig
Socket.setPerformancePreferences(int, int, int)指定的性能首选项。
setPerformancePreferences在界面
OioSocketChannelConfig
setPerformancePreferences在界面
SocketChannelConfig
setPerformancePreferences在课堂上
DefaultSocketChannelConfig
public OioSocketChannelConfig setAllowHalfClosure(boolean allowHalfClosure)
SocketChannelConfig
true当远程对等关闭输出时连接未关闭。
相反, ChannelInboundHandler.userEventTriggered(ChannelHandlerContext, Object)调用一个ChannelInputShutdownEvent对象。
如果false ,连接自动关闭。
setAllowHalfClosure在界面
OioSocketChannelConfig
setAllowHalfClosure在界面
SocketChannelConfig
setAllowHalfClosure在课堂上
DefaultSocketChannelConfig
public OioSocketChannelConfig setConnectTimeoutMillis(int connectTimeoutMillis)
ChannelConfig复制的描述
Channel不支持连接操作,则完全不使用此属性,因此将被忽略。
setConnectTimeoutMillis在界面
ChannelConfig
setConnectTimeoutMillis在界面
OioSocketChannelConfig
setConnectTimeoutMillis在界面
SocketChannelConfig
setConnectTimeoutMillis在课堂上
DefaultSocketChannelConfig
connectTimeoutMillis - 以毫秒为单位的连接超时。
0禁用。
@Deprecated public OioSocketChannelConfig setMaxMessagesPerRead(int maxMessagesPerRead)
DefaultChannelConfig
setMaxMessagesPerRead在界面
ChannelConfig
setMaxMessagesPerRead ,界面
OioSocketChannelConfig
setMaxMessagesPerRead在界面
SocketChannelConfig
setMaxMessagesPerRead在课堂上
DefaultSocketChannelConfig
public OioSocketChannelConfig setWriteSpinCount(int writeSpinCount)
ChannelConfig
WritableByteChannel.write(ByteBuffer)返回非零值。
它类似于在并发编程中使用自旋锁。
它可以提高内存利用率并根据运行JVM的平台来编写吞吐量。
默认值是16 。
setWriteSpinCount接口
ChannelConfig
setWriteSpinCount在界面
OioSocketChannelConfig
setWriteSpinCount接口
SocketChannelConfig
setWriteSpinCount类
DefaultSocketChannelConfig
public OioSocketChannelConfig setAllocator(ByteBufAllocator allocator)
ChannelConfig复制的描述
ByteBufAllocator 。
setAllocator在界面
ChannelConfig
setAllocator在界面
OioSocketChannelConfig
setAllocator在界面
SocketChannelConfig
setAllocator在课堂上
DefaultSocketChannelConfig
public OioSocketChannelConfig setRecvByteBufAllocator(RecvByteBufAllocator allocator)
ChannelConfig
RecvByteBufAllocator 。
setRecvByteBufAllocator在界面
ChannelConfig
setRecvByteBufAllocator接口
OioSocketChannelConfig
setRecvByteBufAllocator在界面
SocketChannelConfig
setRecvByteBufAllocator在课堂上
DefaultSocketChannelConfig
public OioSocketChannelConfig setAutoRead(boolean autoRead)
ChannelConfig
ChannelHandlerContext.read(),以便用户应用程序根本不需要调用它。
默认值是true 。
setAutoRead在界面
ChannelConfig
setAutoRead在界面
OioSocketChannelConfig
setAutoRead在界面
SocketChannelConfig
setAutoRead在课堂上
DefaultSocketChannelConfig
protected void autoReadCleared()
DefaultChannelConfig
DefaultChannelConfig.setAutoRead(boolean)被称为与
false和
DefaultChannelConfig.isAutoRead()为
true之前。
autoReadCleared在课堂上
DefaultChannelConfig
public OioSocketChannelConfig setAutoClose(boolean autoClose)
setAutoClose接口
ChannelConfig
setAutoClose在界面
OioSocketChannelConfig
setAutoClose在界面
SocketChannelConfig
setAutoClose ,课时
DefaultSocketChannelConfig
public OioSocketChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark)
ChannelConfig
设置写入缓冲区的高位标记。 如果写入缓冲区中排队的字节数超过此值,则Channel.isWritable()将开始返回false 。
setWriteBufferHighWaterMark在界面
ChannelConfig
setWriteBufferHighWaterMark在界面
OioSocketChannelConfig
setWriteBufferHighWaterMark在课堂上
DefaultSocketChannelConfig
public OioSocketChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark)
ChannelConfig
设置写入缓冲区的低水位标志。 一旦写入缓冲区中排队的字节数超过了high water mark ,然后下降到此值以下, Channel.isWritable()将再次开始返回true 。
setWriteBufferLowWaterMark在界面
ChannelConfig
setWriteBufferLowWaterMark在界面
OioSocketChannelConfig
setWriteBufferLowWaterMark在课堂上
DefaultSocketChannelConfig
public OioSocketChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark)
ChannelConfig复制的描述
WriteBufferWaterMark ,用于设置写入缓冲区的高位和低位水印。
setWriteBufferWaterMark在界面
ChannelConfig
setWriteBufferWaterMark在界面
OioSocketChannelConfig
setWriteBufferWaterMark在界面
SocketChannelConfig
setWriteBufferWaterMark
DefaultSocketChannelConfig
public OioSocketChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator)
ChannelConfig复制的描述
MessageSizeEstimator以检测消息的大小。
setMessageSizeEstimator在界面
ChannelConfig
setMessageSizeEstimator在界面
OioSocketChannelConfig
setMessageSizeEstimator在界面
SocketChannelConfig
setMessageSizeEstimator在课堂上
DefaultSocketChannelConfig
Copyright © 2008–2018 The Netty Project. All rights reserved.