in reply to SIGCHLD interrupting accept call?

I just tested your code on Linux 2.0.36 / Perl 5.005_02 and it worked just fine (the server program does not exit).

Here are a few ideas in no particular order:

You may want to try using lsof to see what the process is doing (lsof is an awesome utility that lets you look at what files, network ports, etc...a process has open. Also works the other way around.. what processes have a partifular file, network port, etc... open).

How does it behave if you connect 2 clients to it? Does the server program exit when the first client disconnects or only after both disconnect? If you disconnect one of them can you connect a third one at that point?

Are you running the most current version of IO::Socket

Try setting your SIGCHLD handler to:

$SIG{CHLD}='IGNORE';

Replies are listed 'Best First'.
RE: Re: SIGCHLD interrupting accept call?
by ZZamboni (Curate) on May 09, 2000 at 07:37 UTC
    I just tested your code on Linux 2.0.36 / Perl 5.005_02 and it worked just fine (the server program does not exit).
    Hm... interesting.
    You may want to try using lsof
    Will do.
    How does it behave if you connect 2 clients to it?
    It exits after the first one disconnect. Even when I run it under the debugger, after returning from the signal handler the accept call exits. Since it did not return with a new socket, the loop terminates. What I think it should be doing is restarting the accept call automatically, as supposedly most modern Unices do.
    Are you running the most current version of IO::Socket
    Yes. Version 1.25.
    Try setting your SIGCHLD handler to: $SIG{CHLD}='IGNORE'
    I did already (I mentioned it in my original post). With that, the program behaves perfectly. That's what gave me the definite indication that it was the return from the signal handler that was messing things up.

    Thanks for your time, and for the lsof pointer. Any other ideas will be very appreciated!

    --ZZamboni