'Address already in use' when using socket

Peter Hansen peter at engcorp.com
Thu Apr 7 18:05:07 EDT 2005


Bearish wrote:
> I get 'Address already in use' errors when using sockets.

Generally one can fix this using:

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

where "sock" is the server socket in question.  Do
this prior to attempting to bind to the port.

-Peter



More information about the Python-list mailing list