EXTERNAL: OSError: [Errno 48] Address already in use

Marko Rauhamaa marko at pacujo.net
Wed Jun 27 13:40:05 EDT 2018


Joaquin Henriquez <joaquin.henriquez at countercept.com>:

>>Subject: EXTERNAL: OSError: [Errno 48] Address already in use
>
> The best way to help if got you to put the relevant code here.
>
> The error you are experiencing means that the Port you are trying to
> bind is already taken by another running process.

That error usually takes place when restarting a server. The server
exited with one or more TCP connections open, which left the connections
in a TIME-WAIT state for some minutes. When the server is restarted and
tries to bind its address again, the ghosts of the previous connections
prevent the socket from being bound.

The problem can be solved by turning on the SO_REUSEADDR flag of the
socket.


Marko



More information about the Python-list mailing list