Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

timeout
Hi,

If the network connection is broken, is there a  way of setting a timeout
after which the LWP request returns?

I've seen that even if I set the timeout to 1 second, it takes much more
time until the request ends.

Thank you.

Octavian


Report this thread to moderator Post Follow-up to this message
Old Post
Octavian Rasnita
05-06-08 01:02 AM


Re: timeout
From: "Gisle Aas" <gisle@aas.no>
> The $ua->timeout() will abort a connection attempt that takes more
> than the given number of seconds, but before LWP start the connect
> call, it looks up the hostname which can take time that's not limited
> by LWP.  After the connection has been established, the timeout value
> is used to terminate requests on sockets with no activity (data coming
> back) for the given amount of time.  But as long as some data comes in
> at least every timeout sec LWP will keep on processing the requests.

Thank you Gisle. Do you know if I can detect if there is no network
connection or if the requested domain was not found, using other methods
before trying to make the request using LWP?

Thank you.

Octavian


Report this thread to moderator Post Follow-up to this message
Old Post
Octavian Rasnita
05-06-08 10:19 AM


Re: timeout
On Tue, May 6, 2008 at 7:27 AM, Octavian Rasnita <orasnita@gmail.com> wrote:
> From: "Gisle Aas" <gisle@aas.no>
> 
>
>  Thank you Gisle. Do you know if I can detect if there is no network
> connection or if the requested domain was not found, using other methods
> before trying to make the request using LWP?
>

You could try to use a module like Net::ADNS (or Net::DNS) to lookup
the hostname yourself.  If you then replace the hostname with a IP
address in the URL you pass to LWP it will bypass the gethostbyname()
step that might block.  You probably need to set the "Host" header in
the request manually if you do this.

--Gisle

Report this thread to moderator Post Follow-up to this message
Old Post
Gisle Aas
05-06-08 10:19 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

LibWWW archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 12:58 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.