java ChannelOption.SO_BACKLOG 有什么作用?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14075688/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What does ChannelOption.SO_BACKLOG do?
提问by jestro
.option(ChannelOption.SO_BACKLOG, 100)
is shown in the Netty 4 upgrade doc. Can you explain what it does?
显示在 Netty 4 升级文档中。你能解释一下它的作用吗?
Thanks!
谢谢!
回答by miku
It's a passed through socket option determining the number of connections queued.
这是一个通过套接字选项确定排队的连接数。
The maximum queue length for incoming connection indications (a request to connect) is set to the backlog parameter. If a connection indication arrives when the queue is full, the connection is refused.
传入连接指示(连接请求)的最大队列长度设置为 backlog 参数。如果队列已满时出现连接指示,则拒绝连接。
- More on netty channels: http://seeallhearall.blogspot.de/2012/06/netty-tutorial-part-15-on-channel.html
- 更多关于网络频道:http://seeallhearall.blogspot.de/2012/06/netty-tutorial-part-15-on-channel.html