|more useful options|
True timeout (nonblocking) on LWP::UserAgent request method?by tomfahle (Priest)
|on Sep 25, 2008 at 22:49 UTC||Need Help??|
tomfahle has asked for the wisdom of the Perl Monks concerning the following question:
I am trying to implement a HTTP-Request (GET) to an unreliable server. The problem is that the server will occasionally deadlock and the request will never succeed. That is the programm runs forever.
To clarify the problem: connect is succesfull (200 OK). But while retrieving the content of the response, the server stucks. Then the connection hangs forever.
I just want to skip the blocking page, that is terminate that request on my side, and do the next request or stop the programm.
DNS is working fine.
Setting a timeout ( $ua->timeout() ) or an alarm doesn't work.
I am aware of Get Timout with LWP which adresses the same problem.
I've tested it on a W2003 Server with Activstate Perl 5.8.8 and 126.96.36.1994 and on Linux 2.6.24-19-generic with Perl 5.8.8 and 5.10.