Client-side TCP socket receiving "Address already in use" upon connect

keegan.csmith at gmail.com keegan.csmith at gmail.com
Sun Sep 3 06:26:19 EDT 2006


> I've read about SO_REUSEADDR. As far as I understand, this is what
> SO_REUSEADDR is for:
...
> I've tried setting this option, but could not see any notable changes...

I was having a similiar problem as you, where as soon as my program
exited, it would get started up again, but could not bind to the same
address.
So i added the follow straight after I create my server object:
server.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)

And it worked. Note that my program was running on Linux, so this might
be a windows issue.




More information about the Python-list mailing list