[Zope] timeoutsocket.py with zope?

Júlio Dinis Silva juliodinis@hotmail.com
Thu, 22 Mar 2001 01:27:31 -0000


One could had this code do z2.py just before the
ayncore.loop():

sockettimeout=60
import timeoutsocket
timeoutsocket.setDefaultSocketTimeout(sockettimeout)

and then any python code you create (external methods, etc) that opens
tcp sockets will "see" this timeoutsocket default set in z2.py.
Note: I tested (on linux 2.3.1.b1) and it works but use it at your
own risk.

Best Regards,
Júlio Dinis Silva

>>From: "Júlio Dinis Silva" <juliodinis@hotmail.com>
>>To: zope@zope.org
>>Subject: Re: [Zope] timeoutsocket.py with zope?
>>Date: Thu, 22 Mar 2001 01:00:40 -0000
>>
>>I get a problem with timeoutsocket using zope on NT, on Linux it works
>>ok,i.e, it gives me socket timeout when it runs for time > 
>>mydefaulttimeout.
>>It's in timeoutsocket.py, line 244, in connect. On NT I tryed
>>in a lower version of zope, so I think could be related with the _socket 
>>of
>>my NT zope's python, I'll try later.
>>
>>Best Regards,
>>Júlio Dinis Silva
>>
>>
>>>From: "Júlio Dinis Silva" <juliodinis@hotmail.com>
>>>To: zope@zope.org
>>>Subject: [Zope] timeoutsocket.py with zope?
>>>Date: Thu, 22 Mar 2001 00:21:48 -0000
>>>
>>>Hi,
>>>
>>>has anyone put timeoutsocket.py
>>>
>>>(http://www.timo-tasi.org/python/timeoutsocket.py)
>>>
>>>to work with zope?
>>>
>>>For instance, doing an external method that fetchs a site
>>>with httplib but add in the code a import of timeoutsocket
>>>and setting the default timeout, something like this:
>>>
>>>import timeoutsocket
>>>import httplib
>>>imeoutsocket.setDefaultSocketTimeout(20)
>>>H = httplib.HTTP("www.python.org")
>>>...
>>>
>>>Regards,
>>>Julio Dinis Silva
>>>
>>>
>>>_________________________________________________________________________
>>>Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
>>>
>>>
>>>_______________________________________________
>>>Zope maillist  -  Zope@zope.org
>>>http://lists.zope.org/mailman/listinfo/zope
>>>**   No cross posts or HTML encoding!  **
>>>(Related lists -
>>>http://lists.zope.org/mailman/listinfo/zope-announce
>>>http://lists.zope.org/mailman/listinfo/zope-dev )
>>
>>_________________________________________________________________________
>>Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
>>
>>
>>_______________________________________________
>>Zope maillist  -  Zope@zope.org
>>http://lists.zope.org/mailman/listinfo/zope
>>**   No cross posts or HTML encoding!  **
>>(Related lists -
>>http://lists.zope.org/mailman/listinfo/zope-announce
>>http://lists.zope.org/mailman/listinfo/zope-dev )
>

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.