in reply to Timeout problem using IO::Socket

*grin*, Don't you guys love this problem ? :)))

I just checked jcwrens option ... can anyone tell
me this is the way to set up an alarm handler ?..
'coz it for sure prints 'Alarm Clock' for me ;))
montest@XXX-test$ ./test 127.0.0.1 I would print to the socket now, if I knew what I was connected to montest@XXX-test$ ./test 127.0.0.2 Alarm Clock montest@XXX-test$
Any Ideas ?.. btw.. thank you all for helping me out here
update Oh, I usually set my alarm handler this way:
$SIG{ALRM}=\&AlarmHandler;

Replies are listed 'Best First'.
RE: Re: Timeout problem using IO::Socket
by Zarathustra (Beadle) on Sep 28, 2000 at 05:23 UTC
    How about setting your alarm more directly, for more accurate debugging -
    $SIG{ALRM} = sub { die "DIE DIE DIE!\n" };
    Show us the actual excerpt of your code -- you're asking us to use our imaginations in dreaming up possibilities for what is obviously a subtle problem.
(tye2)Re: Timeout problem using IO::Socket
by tye (Sage) on Sep 27, 2000 at 19:46 UTC

    $SIG{ALRM}=\&AlarmHandler;

    Well, that looks right as far as it goes. But if your program is printing "Alarm Clock" and then dieing, then you almost certainly are not setting up your alarm handler properly. Perhaps you are doing this too late, undoing it too early, have it in some conditional that you think is being run but isn't, etc. Perhaps some other code is setting up its own alarm handler and overwriting yours. You might want to step through this with the Perl debugger.

            - tye (but my friends call me "Tye")