develooper Front page | perl.perl5.porters | Postings from July 2007

[perl #44259] Socket::SOXMAXCONN() on Solaris

Thread Next
From:
David Schweikert
Date:
July 30, 2007 09:57
Subject:
[perl #44259] Socket::SOXMAXCONN() on Solaris
Message ID:
rt-3.6.HEAD-23341-1185800952-412.44259-75-0@perl.org
# New Ticket Created by  David Schweikert 
# Please include the string:  [perl #44259]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=44259 >


This is a bug report for perl from david@schweikert.ch,
generated with the help of perlbug 1.35 running under perl v5.8.8.


-----------------------------------------------------------------
Socket::SOMAXCONN() on Solaris always returns 5, which is also the value that
can be found in sys/socket.h. In reality, Solaris supports more than 5 as
backlog argument to listen() and SOMAXCONN is defined as 5 for historical
reasons (I presume). The real value can be tuned at runtime and queried with
the following command:

$ ndd /dev/tcp tcp_conn_req_max_q

The consequence of the fact that Socket::SOMAXCONN() always returns 5 on
Solaris is that applications which want the highest possible value of backlog
for listen(), might call Socket::SOMAXCONN() to find out what that value is and
end up using a pretty low value for it. Net::Server does so for example.

I propose to do one of the following:

- Find out the real value at run-time when Socket::SOMAXCONN() is called. I
  don't know however if there is an efficient method to do this (i.e. without
  calling ndd)

- Return a higher fixed value on Solaris. I think that a minimum like 128 should
  be available everywhere. The default is 1024...

Thanks and Cheers
David Schweikert

[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
    category=library
    severity=medium
---
Site configuration information for perl v5.8.8:

Configured by root at Thu Jun 14 19:28:09 MEST 2007.

Summary of my perl5 (revision 5 version 8 subversion 8) configuration:
  Platform:
    osname=solaris, osvers=2.8, archname=sun4-solaris
    uname='sunos turbine 5.8 generic_117000-05 sun4u sparc sunw,sun-fire-v240 '
    config_args='-ds -e -Dprefix=/opt/perl -Dotherlibdirs=/opt/perlm/lib:/opt/ssl/cpan/lib:/opt/bdb/cpan/lib:/opt/pgsql/cpan/lib:/opt/apach/cpan/lib:/opt/apch2/cpan/lib -Dnoextensions=DB_File -Dpager=/usr/bin/less -isR'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O',
    cppflags='-fno-strict-aliasing -pipe -I/usr/local/include'
    ccversion='', gccversion='3.2.3', gccosandvers='solaris2.8'
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib '
    libpth=/usr/local/lib /usr/lib /usr/ccs/lib
    libs=-lsocket -lnsl -ldb -ldl -lm -lc
    perllibs=-lsocket -lnsl -ldl -lm -lc
    libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-fPIC', lddlflags='-G -L/usr/local/lib'

Locally applied patches:
    

---
@INC for perl v5.8.8:
    /opt/perl/lib/5.8.8/sun4-solaris
    /opt/perl/lib/5.8.8
    /opt/perl/lib/site_perl/5.8.8/sun4-solaris
    /opt/perl/lib/site_perl/5.8.8
    /opt/perl/lib/site_perl
    /opt/perlm/lib/sun4-solaris
    /opt/perlm/lib
    /opt/ssl/cpan/lib/5.8.8/sun4-solaris
    /opt/ssl/cpan/lib/5.8.8
    /opt/ssl/cpan/lib
    /opt/bdb/cpan/lib/5.8.8/sun4-solaris
    /opt/bdb/cpan/lib/5.8.8
    /opt/bdb/cpan/lib
    /opt/pgsql/cpan/lib/5.8.8/sun4-solaris
    /opt/pgsql/cpan/lib/5.8.8
    /opt/pgsql/cpan/lib
    /opt/apach/cpan/lib/5.8.8/sun4-solaris
    /opt/apach/cpan/lib/5.8.8
    /opt/apach/cpan/lib
    /opt/apch2/cpan/lib
    .

---
Environment for perl v5.8.8:
    HOME=/net/users/dws
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/net/users/dws/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/openwin/bin:/usr/ccs/bin:/usr/ucb:/opt/base/bin
    PERL_BADLANG (unset)
    SHELL=/bin/bash


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About