[Pythonmac-SIG] Error 45 with Paos and setsockopt

Schollnick, Benjamin Benjamin.Schollnick@usa.xerox.com
Mon, 10 Sep 2001 08:10:23 -0400


> 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.

Or even better, capture the error, and if it is Address in Use, place a 
error message ("Port busy, retrying in 15 seconds...").  Then sleep, and
retry.

			- Benjamin

-----Original Message-----
From: Jack Jansen [mailto:jack@oratrix.nl]
Sent: Monday, September 10, 2001 6:45 AM
To: Stefan Witzgall
Cc: pythonmac-sig@python.org
Subject: Re: [Pythonmac-SIG] Error 45 with Paos and setsockopt



> 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




_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig