Doug Fort dougfort at
Thu Jun 14 06:55:28 EDT 2001

mixo wrote:

> I create a socket and listen for connections  in try and , close  socket
> in a except. Also, within the try I have a while loop that I create a
> socket
> once a connection has been made to a client., and close the socket once
> data has been sent to a client. Now, my problem is, if at least  one
> connection is made, when the server dies, I can't restart it as I
> can't create a new socket for the server.. Is there something
> that hapens when a connection is accepted that prevents a restart
> of the server?
> P.S I am using the socket module.
Try using something like:
self.socket.setsockopt(socket.SOL_SOCKET, socket.S_REUSEADDR, 1)

Note:  This code was lifted from the library module.  It's 
worth reading that module in detail if you're going to use sockets.
Doug Fort <dougfort at>
Senior Meat Manager
Downright Software LLC

Posted Via Uncensored-News.Com - Still Only $9.95 -
   With Seven Servers In California And Texas - The Worlds Uncensored News Source

More information about the Python-list mailing list