IB2017 has asked for the wisdom of the Perl Monks concerning the following question:
Hello
I use the following to retrieve from server the version number of the latest available update of my software.
my $ua = LWP::UserAgent->new; my $req = HTTP::Request->new(GET => $url); my $res = $ua->request($req); $ua->timeout(0.1);
This works fine execpt if there is a connection problem. For example, the server has been down for the whole weekend now (!!!). In such a case, my GUI application - while running this peace of code - freezes for ca. 15 seconds. This is not acceptable. What I want is that if there is no response from the server, no matter the reasons, the application just skip this check. I tried to replace LWP::UserAgent with LWPx::ParanoidAgent, but this did not lead to any improvement. Any other idea?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: LWP::UserAgent timeout
by bliako (Abbot) on Dec 17, 2018 at 13:36 UTC | |
by markong (Pilgrim) on Dec 17, 2018 at 14:09 UTC | |
by IB2017 (Pilgrim) on Dec 17, 2018 at 17:42 UTC | |
by tybalt89 (Monsignor) on Dec 17, 2018 at 22:36 UTC | |
by markong (Pilgrim) on Dec 17, 2018 at 21:39 UTC | |
by bliako (Abbot) on Dec 18, 2018 at 00:57 UTC | |
by IB2017 (Pilgrim) on Dec 17, 2018 at 13:48 UTC | |
Re: LWP::UserAgent timeout
by talexb (Chancellor) on Dec 17, 2018 at 14:35 UTC | |
by IB2017 (Pilgrim) on Dec 17, 2018 at 17:49 UTC | |
Re: LWP::UserAgent timeout
by markong (Pilgrim) on Dec 17, 2018 at 13:20 UTC | |
Re: LWP::UserAgent timeout
by perlancar (Hermit) on Dec 19, 2018 at 11:23 UTC |