[Twisted-Python] implementing a timeout

J Davis mrsalty0 at gmail.com
Sat Dec 1 12:01:32 EST 2007


Ah yes, I should have thought to check the source for web.client.

Thank You!

-Jake


On Nov 29, 2007 7:30 PM, Jean-Paul Calderone <exarkun at divmod.com> wrote:

> On Thu, 29 Nov 2007 18:45:27 -0500, J Davis <mrsalty0 at gmail.com> wrote:
> >Greetings,
> >
> >I'm a newcomer to twisted and am struggling a little with the learning
> >curve.
> >I have an idea for an app that I believe is ideally suited for twisted
> >though I
> >could use some help finding the right way to approach it.
> >
> >It performs a status check by getting a page from a web server.
> >It calculates the time it took to download the page and also can check
> that
> >the
> >content matches a predefined string.
> >
> >That part of it is working fine but I'd like to take it a step further.
> >I need a way to impose a limit on how long it waits to receive a response
> so
> >that I can detect
> >unresponsive hosts. I must say that I'm at a loss as to how to add such a
> >timeout to my code.
> >Any pointers or examples would be greatly appreciated.
>
> You can pass a timeout keyword argument to getPage.  This will set the
> maximum time which is allowed to elapsed between when the TCP connection
> is established to the remote host and when the page is completely loaded.
>
> Jean-Paul
>
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20071201/0afb8d13/attachment.htm 


More information about the Twisted-Python mailing list