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