socket.SO_REUSEADDR

fredrik at pythonware.com fredrik at pythonware.com
Thu Apr 20 14:23:23 CEST 2000


Michael Ströder wrote:
> For avoiding problems with errors like
>
>   socket.error: (98, 'Address already in use.')
>
> during immediate restart of my web server I'm following the hint to
> set the socket option SO_REUSEADDR. But I did not succeed. The
> server starts and works. When I stop it and try to restart
> immediately the above message appears again. I had a short look at
> man 7 socket and man setsockopt but this was a little bit too much
> for me...

that getproto stuff looks strange.  try this instead:

   self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)

</F>


Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list