copied from the SunOS manual entry way back when) so SOMAXCONN, so
that the socket will queue as many incoming connections as it's able
to handle ongoing connections. In other words, it will never now
refuse a connection that it would be able to handle merely because
it's not got around to accepting() enough of the pending connections
yet. This is the behaviour anyway under Linux, where the listen()
argument is ignored; but not under BSD and on systems such as
MS-Windows that use BSD-derived TCP/IP stacks. The behaviour of
YAZ-based servers should now be uniform across operating systems in
this respect.
* Copyright (C) 1995-2005, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: tcpip.c,v 1.16 2005-06-25 15:46:06 adam Exp $
+ * $Id: tcpip.c,v 1.17 2005-07-19 12:40:52 mike Exp $
*/
/**
* \file tcpip.c
h->cerrno = CSYSERR;
return -1;
}
- if (mode == CS_SERVER && listen(h->iofile, 3) < 0)
+ /* Allow a maximum-sized backlog of waiting-to-connect clients */
+ if (mode == CS_SERVER && listen(h->iofile, SOMAXCONN) < 0)
{
h->cerrno = CSYSERR;
return -1;