Newbie question: SOLVED (how to keep a socket listening), but still some questions

Peter Hansen peter at engcorp.com
Fri Jun 24 21:26:52 EDT 2005


Giovanni Tumiati wrote:
> However some of my questions still remain from earlier post:
> (1) What is the difference between / how should they be used?
>  - setdefaulttimeout(timeout)
>  - settimeout(value)

I think it's basically as you surmised.  Calling 
socket.setdefaulttimeout() (where "socket" is the module itself) sets up 
the default timeout value for all subsequently created sockets.  Calling 
sock.settimeout() (where "sock" is a specific socket object) changes the 
timeout value on that socket alone.

> (2)Does one have to do a socket.shutdown() before one does a socket.close??

Not normally, AFAIK.

-Peter



More information about the Python-list mailing list