ccn has asked for the wisdom of the Perl Monks concerning the following question:

Hi monks, I have a simple TCP/IP server written in Perl.
use IO::Socket; $server = IO::Socket::INET->new(LocalPort => $server_port, Type => SOCK_STREAM, Reuse => 1, Listen => 10 ) # or SOMAXCONN or die "Couldn't be a tcp server on port $server_port : $@\n"; while ($client = $server->accept()) { # $client is the new connection } close($server);
The "Listen" parameter tells a size of a connections queue.

I'd like to know how many pending connecions I have at any time.
Is it possible to trace a listen queue of a socket?

Replies are listed 'Best First'.
•Re: How to trace a listen queue of a socket?
by merlyn (Sage) on Apr 21, 2004 at 20:11 UTC
    "Listen" is passed through to the kernel, which manages the incoming queue. Unless you have a (non-standard) ioctl on your socket manpage (not Perl's page, but the OS docs) to fetch that, you probably won't be able to know.

    -- Randal L. Schwartz, Perl hacker
    Be sure to read my standard disclaimer if this is a reply.