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" |
|
"receiveBufferSize" |
数据包接收大小 |
"receiveBufferSizePredictor" |
数据包接收大小:默认设置为FixedReceiveBufferSizePredictor(768),超过后丢弃 |
"receiveBufferSizePredictorFactory" |
似乎与上面的功能相同,设置方式:new FixedReceiveBufferSizePredictorFactory(1024) |
"sendBufferSize" |
|
"timeToLive" |
JDK7+版本有效 |
"trafficClass" |
|
bufferFactory" |
用于创建ChannelBuffer的工厂,默认HeapChannelBufferFactory |
"connectTimeoutMillis" |
|
"pipelineFactory" |
仅适用于child channel 创建时有效 |
"keepAlive" |
启用/禁用Nagle算法 |
"soLinger" |
Socket关闭时的延迟时间(单位:秒) |
"tcpNoDelay" |
启用/禁用Nagle算法 |