org.jboss.netty.channel.socket.nio
接口 NioSocketChannelConfig

所有超级接口:
ChannelConfig, SocketChannelConfig

public interface NioSocketChannelConfig
extends SocketChannelConfig

一个NIO TCP/IP SocketChannelSocketChannelConfig.

有效属性

ChannelConfigSocketChannelConfig还提供其他的属性, NioSocketChannelConfig有以下属性:
名称 关联setter方法
"writeBufferHighWaterMark" setWriteBufferHighWaterMark(int)
"writeBufferLowWaterMark" setWriteBufferLowWaterMark(int)
"writeSpinCount" setWriteSpinCount(int)
"receiveBufferSizePredictor" setReceiveBufferSizePredictor(ReceiveBufferSizePredictor)
"receiveBufferSizePredictorFactory" setReceiveBufferSizePredictorFactory(ReceiveBufferSizePredictorFactory)


方法摘要
 ReceiveBufferSizePredictor getReceiveBufferSizePredictor()
          返回用来预测套接字接收缓冲的可读字节数的ReceiveBufferSizePredictor.默认预测机是 AdaptiveReceiveBufferSizePredictor(64, 1024, 65536).
 ReceiveBufferSizePredictorFactory getReceiveBufferSizePredictorFactory()
          返回当一个新通道被创建和ReceiveBufferSizePredictor没有被设置时创建一个新的 ReceiveBufferSizePredictorReceiveBufferSizePredictorFactory.如果该通道没有设置预测机,带有新预测机的 setReceiveBufferSizePredictor(ReceiveBufferSizePredictor)方法会被调用.
 int getWriteBufferHighWaterMark()
          返回写缓冲的高水位标记.如果写缓冲队列里的字节数超过该值,Channel.isWritable()会开始返回 true.
 int getWriteBufferLowWaterMark()
          返回写缓冲的低水位标记.一旦写缓冲队列里字节数超过 高水位标记,随后回落到该值,Channel.isWritable()会重新返回true.
 int getWriteSpinCount()
          返回写操作的最大回路数直到WritableByteChannel.write(ByteBuffer) 返回一个非零值为止.它类似在并发编程里使用什么样的自旋锁.它利用JVM所运行的平台改善内存利用率和写的吞吐量.默认值为16.
 void setReceiveBufferSizePredictor(ReceiveBufferSizePredictor predictor)
          设置用来预测套接字接收缓冲的可读字节数的ReceiveBufferSizePredictor.默认预测机是 AdaptiveReceiveBufferSizePredictor(64, 1024, 65536).
 void setReceiveBufferSizePredictorFactory(ReceiveBufferSizePredictorFactory predictorFactory)
          设置当一个新通道被创建和ReceiveBufferSizePredictor没有被设置时创建一个新的 ReceiveBufferSizePredictorReceiveBufferSizePredictorFactory.如果该通道没有设置预测机,带有新预测机的 setReceiveBufferSizePredictor(ReceiveBufferSizePredictor)方法会被调用.
 void setWriteBufferHighWaterMark(int writeBufferHighWaterMark)
          设置写缓冲的高水位标记.如果写缓冲队列里的字节数超过该值,Channel.isWritable()会开始返回 true.
 void setWriteBufferLowWaterMark(int writeBufferLowWaterMark)
          设置写缓冲的低水位标记.一旦写缓冲队列里字节数超过 高水位标记,随后回落到该值,Channel.isWritable()会重新返回true.
 void setWriteSpinCount(int writeSpinCount)
          设置写操作的最大回路数直到WritableByteChannel.write(ByteBuffer) 返回一个非零值为止.它类似在并发编程里使用什么样的自旋锁.它利用JVM所运行的平台改善内存利用率和写的吞吐量.默认值为16.
 
从接口 org.jboss.netty.channel.socket.SocketChannelConfig 继承的方法
getReceiveBufferSize, getSendBufferSize, getSoLinger, getTrafficClass, isKeepAlive, isReuseAddress, isTcpNoDelay, setKeepAlive, setPerformancePreferences, setReceiveBufferSize, setReuseAddress, setSendBufferSize, setSoLinger, setTcpNoDelay, setTrafficClass
 
从接口 org.jboss.netty.channel.ChannelConfig 继承的方法
getBufferFactory, getConnectTimeoutMillis, getPipelineFactory, setBufferFactory, setConnectTimeoutMillis, setOption, setOptions, setPipelineFactory
 

方法详细信息

getWriteBufferHighWaterMark

int getWriteBufferHighWaterMark()
返回写缓冲的高水位标记.如果写缓冲队列里的字节数超过该值,Channel.isWritable()会开始返回 true.


setWriteBufferHighWaterMark

void setWriteBufferHighWaterMark(int writeBufferHighWaterMark)
设置写缓冲的高水位标记.如果写缓冲队列里的字节数超过该值,Channel.isWritable()会开始返回 true.


getWriteBufferLowWaterMark

int getWriteBufferLowWaterMark()
返回写缓冲的低水位标记.一旦写缓冲队列里字节数超过 高水位标记,随后回落到该值,Channel.isWritable()会重新返回true.


setWriteBufferLowWaterMark

void setWriteBufferLowWaterMark(int writeBufferLowWaterMark)
设置写缓冲的低水位标记.一旦写缓冲队列里字节数超过 高水位标记,随后回落到该值,Channel.isWritable()会重新返回true.


getWriteSpinCount

int getWriteSpinCount()
返回写操作的最大回路数直到WritableByteChannel.write(ByteBuffer) 返回一个非零值为止.它类似在并发编程里使用什么样的自旋锁.它利用JVM所运行的平台改善内存利用率和写的吞吐量.默认值为16.


setWriteSpinCount

void setWriteSpinCount(int writeSpinCount)
设置写操作的最大回路数直到WritableByteChannel.write(ByteBuffer) 返回一个非零值为止.它类似在并发编程里使用什么样的自旋锁.它利用JVM所运行的平台改善内存利用率和写的吞吐量.默认值为16.

抛出:
java.lang.IllegalArgumentException - 如果指定的值是0或小于0,则抛出异常

getReceiveBufferSizePredictor

ReceiveBufferSizePredictor getReceiveBufferSizePredictor()
返回用来预测套接字接收缓冲的可读字节数的ReceiveBufferSizePredictor.默认预测机是 AdaptiveReceiveBufferSizePredictor(64, 1024, 65536).


setReceiveBufferSizePredictor

void setReceiveBufferSizePredictor(ReceiveBufferSizePredictor predictor)
设置用来预测套接字接收缓冲的可读字节数的ReceiveBufferSizePredictor.默认预测机是 AdaptiveReceiveBufferSizePredictor(64, 1024, 65536).


getReceiveBufferSizePredictorFactory

ReceiveBufferSizePredictorFactory getReceiveBufferSizePredictorFactory()
返回当一个新通道被创建和ReceiveBufferSizePredictor没有被设置时创建一个新的 ReceiveBufferSizePredictorReceiveBufferSizePredictorFactory.如果该通道没有设置预测机,带有新预测机的 setReceiveBufferSizePredictor(ReceiveBufferSizePredictor)方法会被调用. 默认工厂是 AdaptiveReceiveBufferSizePredictorFactory(64, 1024, 65536) .


setReceiveBufferSizePredictorFactory

void setReceiveBufferSizePredictorFactory(ReceiveBufferSizePredictorFactory predictorFactory)
设置当一个新通道被创建和ReceiveBufferSizePredictor没有被设置时创建一个新的 ReceiveBufferSizePredictorReceiveBufferSizePredictorFactory.如果该通道没有设置预测机,带有新预测机的 setReceiveBufferSizePredictor(ReceiveBufferSizePredictor)方法会被调用. 默认工厂是 AdaptiveReceiveBufferSizePredictorFactory(64, 1024, 65536) .