Netty ChannelOption 解释

Name

Associated setter method

"writeBufferHighWaterMark"

默认 64 * 1024(用法未知

"writeBufferLowWaterMark"

默认 32 * 1024(用法未知

"writeSpinCount"

默认 16(重复写次数,用法未知

"broadcast"

true / false 多播模式(UDP适用)

"interface"

多播数据包的网络接口地址

"loopbackModeDisabled"

实际调用的是channel.setOption(StandardSocketOptions.IP_MULTICAST_LOOP, loopbackModeDisabled);仅针对JDK7+有效

"networkInterface"

实际调用的是channel.setOption(StandardSocketOptions.IP_MULTICAST_IF, networkInterface);仅针对JDK7+有效

"reuseAddress"

地址是否可复用(UDP socket address绑定时用到)

"receiveBufferSize"

数据包接收大小

"receiveBufferSizePredictor"

数据包接收大小:默认设置为FixedReceiveBufferSizePredictor(768),超过后丢弃

"receiveBufferSizePredictorFactory"

似乎与上面的功能相同,设置方式:new FixedReceiveBufferSizePredictorFactory(1024)

"sendBufferSize"

发送数据包大小

"timeToLive"

JDK7+版本有效

"trafficClass"

0<=tc<=255

bufferFactory"

用于创建ChannelBuffer的工厂,默认HeapChannelBufferFactory

"connectTimeoutMillis"

连接超时时间(毫秒)

"pipelineFactory"

仅适用于child channel 创建时有效

"keepAlive"

启用/禁用Nagle算法

"soLinger"

Socket关闭时的延迟时间(单位:秒)

"tcpNoDelay"

启用/禁用Nagle算法

posted on 2016-08-10 17:39  舒润  阅读(1727)  评论(0编辑  收藏  举报

导航