Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

LWP::Simple no timeout

Posted on 2011-02-22
2
Medium Priority
?
737 Views
Last Modified: 2012-05-11
Hi, I'm trying to call a webservice through perl script's LWP::Simple. The webservice may take a long time to respond. I want to avoid timeout issue. Is there a way to set no timeout for LWP::Simple? Will the following work? Thanks! -Ming

while (my $fileid = <FILE>) {
        chomp $fileid;
       $ua->timeout(7200);
        my $html = get("http://myurl/cmWebServices/cmImport?fileID=$fileid");
        if ( ! defined $html ) {
            $errorLog->error("$fileid failed");
        } else {
            my $end = Time::HiRes::gettimeofday();
            my $logString = $fileid . "\t" . sprintf("%.4f\n", $end-$start);
            $infoLog->info($logString);
        }
    }
 
0
Comment
Question by:mybluegrass
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 8

Accepted Solution

by:
point_pleasant earned 1000 total points
ID: 34961260
That would work for 2 hours but your DNS server may time out well before then.  the issue is in

DNS Timeout in IO::Socket::INET
0
 
LVL 1

Author Comment

by:mybluegrass
ID: 34963966
You are right. It's not perl problem. It's the backend tomcat server thread timeout. Thanks!
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question