listen() socket call

listen() socket call

Post by Damian Cow » Fri, 18 Apr 1997 04:00:00



Environment: Solaris2.4

The man page for listen(3N) states:

      int listen(int s, int backlog);

[snip]

      There is currently no backlog limit.

But in the file /usr/include/sys/socket.h I see:

/*
 * Maximum queue length specifiable by listen.
 */
#define SOMAXCONN       5

So, which is true? Is the backlog 5, or something else???

Thanks in advance,


 
 
 

listen() socket call

Post by Andreas Karr » Fri, 18 Apr 1997 04:00:00



>The man page for listen(3N) states:

>      There is currently no backlog limit.

>But in the file /usr/include/sys/socket.h I see:

>#define SOMAXCONN       5

>So, which is true? Is the backlog 5, or something else???

You can get more than 5 connections to the same port on Solaris 2.

I'd guess the SOMAXCONN was left in socket.h as is because a lot
of code blindly uses that "maximum" value. It used to be a hard limit
in 4.2BSD, and probably in a lot of systems based on that code.

 - Andi