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

Re: how can I timeout a function like "read" when reading from a socket

by Crian (Curate)
on Mar 08, 2004 at 11:26 UTC ( [id://334762]=note: print w/replies, xml ) Need Help??


in reply to how can I timeout a function like "read" when reading from a socket

You could calculate your own timeout time depending on the length of the input after receiving the header like

my $timeout = 120 + int($size/1024)*60;

or something simular. Perhaps you have to play around with the "120" and "60" to get values fitting with your environment. Other posts pointed out how to set this timeout-time after calculating it.
  • Comment on Re: how can I timeout a function like "read" when reading from a socket
  • Download Code

Replies are listed 'Best First'.
Re: Re: how can I timeout a function like "read" when reading from a socket
by Goatee (Novice) on Mar 08, 2004 at 13:45 UTC
    thanks for the help......its finally running now:)
    good idea with the timout calculation....was thinking about different timeouts but thats a much better solution
    with a basic timeout and an additional time depending on length :)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://334762]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (7)
As of 2024-04-23 10:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found