getting socket.bind() exception, but no actual error

Michael Fuhr mfuhr at
Tue Nov 2 19:42:04 CET 2004

clarence at (Clarence Gardner) writes:

> And the whole point of the test in the exception handling suite (checking
> for "in use") is to repeat the bind until that's not the case. This is, of
> course, in a program in development which sometimes is not able to be 
> restarted right away after a problem.

Why not?  Because you get "Address already in use" exceptions due
to old connections still being in the TIME_WAIT state?  If so, are
you aware that server processes should usually set the SO_REUSEADDR
socket option before calling bind()?  Or is there some other reason
that bind() fails?

Michael Fuhr

More information about the Python-list mailing list