简体   繁体   English

在Java中检查服务器套接字队列中的连接数

[英]Check number of connections in the queue of a server socket in Java

I have a Java program that creates a server socket and accepts connections from various clients. 我有一个Java程序,该程序创建一个服务器套接字并接受来自各种客户端的连接。

I am interested in finding out the number of connections that are in queue (waiting to be processed by the server). 我有兴趣找出队列中的连接数(等待服务器处理)。 I have used the default constructor without specifying the backlog parameter. 我使用了默认的构造函数而未指定backlog参数。

At runtime, is it possible to know how many connections are pending for the server? 在运行时,是否可以知道有多少个服务器挂起连接?

I want to implement a monitor process, which will check how full the queue is and based on that, trigger clone processes for load balancing (so that the connections are not dropped). 我要实现一个监视进程,该进程将检查队列的满度,并基于该进程触发克隆进程以实现负载平衡(这样就不会断开连接)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM