Netty的几种socket选项与java socket 对应关系

在创建BootStrap时,可以为它设置option

有以下几种

NameAssociatedsettermethod

"keepAlive"setKeepAlive(boolean)

"reuseAddress"setReuseAddress(boolean)

"soLinger"setSoLinger(int)

"tcpNoDelay"setTcpNoDelay(boolean)

"receiveBufferSize"setReceiveBufferSize(int)

"sendBufferSize"setSendBufferSize(int)

"trafficClass"setTrafficClass(int)

"bufferFactory"setBufferFactory(ChannelBufferFactory)

"connectTimeoutMillis"setConnectTimeoutMillis(int)

"pipelineFactory"setPipelineFactory(ChannelPipelineFactory)

具体解释:

http://docs.jboss.org/netty/3.2/api/org/jboss/netty/channel/socket/SocketChannelConfig.html

http://www.nptpark.com

相关推荐