如何增加最大连接数?

studyingpersons 2003-08-30 12:06:31
Winsock编程中,默认的最大连接数是5,如何增大这个连接数呢?
...全文
168 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
studyingpersons 2003-08-30
  • 打赏
  • 举报
回复
up && gz
studyingpersons 2003-08-30
  • 打赏
  • 举报
回复
自己顶一下!
studyingpersons 2003-08-30
  • 打赏
  • 举报
回复
那么我们经常见到的Winsock程序中可以设定的最大连接数是什么?
我在线等待!
windbells 2003-08-30
  • 打赏
  • 举报
回复
你说的不是最大连接数,而是bsd socket的默认socket处理队列的大小,队列里面放着是已经连接未被处理的socket请求(也就是没有accept),如果想改变这个大小的话,int listen(
SOCKET s,
int backlog
);
Parameters
s
[in] Descriptor identifying a bound, unconnected socket.
backlog
[in] Maximum length of the queue of pending connections. If set to SOMAXCONN, the underlying service provider responsible for socket s will set the backlog to a maximum reasonable value. There is no standard provision to obtain the actual backlog value.

第二个参数就是设置这个队列的大小。
everandforever 2003-08-30
  • 打赏
  • 举报
回复
SOCKET?
5是最大并发连接数. 同一时刻能接受的最大连接数目, 不是总连接数.

18,356

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 网络编程
c++c语言开发语言 技术论坛(原bbs)
社区管理员
  • 网络编程
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧