gpt4 book ai didi

java - java ServerSocket 队列的大小

转载 作者:行者123 更新时间:2023-11-30 05:14:49 24 4
gpt4 key购买 nike

我们可以获取 java ServerSocket 队列 的状态(可用空间)吗??

目标是在满时抛出异常......

<小时/>

有关 ServerSocket 的一些详细信息队列:

Class ServerSocket

...

ServerSocket()

...

The maximum queue length for incoming connection indications (a request to connect) is set to 50. If a connection indication arrives when the queue is full, the connection is refused.

...

ServerSocket(int port, int backlog)

...

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.

最佳答案

不,队列由操作系统管理,不在 SDK 的权限范围内。

关于java - java ServerSocket 队列的大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1960173/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com