[Tutor] socket timeout

Stefan Lesicnik stefan at lsd.co.za
Sat Nov 28 17:56:29 CET 2009


----- "Sander Sweers" <sander.sweers at gmail.com> wrote:

> 2009/11/27 Stefan Lesicnik <stefan at lsd.co.za>:
> > s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
> > #s.setdefaulttimeout(10000)
> > s.connect((proxy,port))
> 
> I have never used socket but a quick look at the docs [1] my guess is
> that you should use use s.settimeout() [2].
> 
> The docs say that setdefaulttimeout [3] will only be applied to *new*
> socket object. You set the default after creating the socket object.
> 

Thanks Sander,

The seemd to fix it up.  Funny how something so simple can plague you for so long :)

Appreciate it.

stefan


More information about the Tutor mailing list