简体   繁体   中英

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.

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.

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).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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