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
Solved

LWP::Simple no timeout

Posted on 2011-02-22
2
708 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
2 Comments
 
LVL 8

Accepted Solution

by:
point_pleasant earned 250 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Perl, group, sort, count question 6 140
Writing a parser for java language 4 83
Regular Expression for URL 10 100
Perl Frameworks 1 96
There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
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…

790 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