Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

unknown socket problem

by Alex the Serb (Monk)
on Jan 18, 2002 at 14:22 UTC ( #139784=perlquestion: print w/replies, xml ) Need Help??

Alex the Serb has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: unknown socket problem
by agoth (Chaplain) on Jan 18, 2002 at 14:54 UTC
    I believe I read somewhere that the timeout in the IO::Socket::INET or whatever doesn't apply to the connection, although I could be mixing my dim perldoc memories.

    UPDATE: I'm right-ish see bottom of post

    So, I have cobbled something out of LWP::ParallelUserAgent, where in the depths of the code, he uses a construct (shown below), there is an equivalent can_read (perldoc IO::Select) method, and these actually give working timeouts if the server / network is AWOL on my system at least

    eval { die if !$sockout->can_write( $TIMEOUT ) }; #-- or : eval { local $SIG{'__WARN__'} = sub { }; #---- ignore warnings i +n the eval $fd = new IO::Socket::INET( PeerAddr => $details{'server'}, PeerPort => $details{'port'}, Proto => 'tcp') or die $@; }; if ($@) { #---- connect fail +ed $log->write('TRACE', "Can't connect TCP $@ \n") if $out; } else { my $sel = IO::Select->new( $fd ); #---- for timeout eval { die if !$sel->can_write( $TIMEOUT ) };
    UPDATE : knew I'd read it somewhere

    Found it: pp 114 Chapter 5 IO::Socket API, Lincoln Stein book

    timeout() gets or sets the timeout value that IO::Socket uses for its connect and accept methods. (snip). The timeout value is not currently used for calls that send or recieve data...

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://139784]
Approved by root
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2022-08-12 06:10 GMT
Find Nodes?
    Voting Booth?

    No recent polls found