我应该使用什么积压值? [英] What value of backlog should I use?

查看:104
本文介绍了我应该使用什么积压值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我阅读了人2收听.

我不知道积压值是多少

backlog参数定义sockfd的未决连接队列可以增长的最大长度

The backlog argument defines the maximum length to which the queue of pending connections for sockfd may grow

正确,我该如何定义最佳值?

Right, how can I define what is the best value?

谢谢

推荐答案

基本上,listen()待办事项影响的是,如果您的应用程序不立即accept()连接就进入连接队列,则有多少输入连接可以排队输入.对于大多数应用程序来说,它并不是特别重要.大多数系统使用的最大值是128,并且通过通常是安全的.

Basically, what the listen() backlog affects is how many incoming connections can queue up if your application isn't accept()ing connections as soon as they come in. It's not particularly important to most applications. The maximum value used by most systems is 128, and passing that is generally safe.

这篇关于我应该使用什么积压值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆