[Pythonmac-SIG] Error 45 with Paos and setsockopt

Jack Jansen jack@oratrix.nl
Mon, 10 Sep 2001 12:45:01 +0200


> The interpreter and the IDE give me an error 45 when running the Server.py
> script:
> 
> ------------------------------Traceback window-------------------------
> error: (45, 'Operation not supported on socket')
> Traceback (innermost last):
> --------------------------------------------------
> File "Server.py", line 50, in ?
>       s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
> --------------------------------------------------

I'm a bit surprised that SO_REUSEADDR isn't supported (but then, I never tried 
it:-).

Anyway, you can safely take this out, usually. Setting SO_REUSEADDR is mostly 
used to be able to quickly listen to a port again after the previous program 
listening to that port has crashed. Normally there is a timeout of about a 
minute.

If you take out this option the only thing you may notice is that if your 
program is aborted and you immedeately try to start it again you will get an 
"Address in use" or something similar. Wait a minute and it will go away.
--
Jack Jansen             | ++++ stop the execution of Mumia Abu-Jamal ++++
Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++
www.cwi.nl/~jack        | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm