SimpleXMLRPCServer Releasing Ports

Fredrik Lundh fredrik at
Wed Oct 9 18:33:46 CEST 2002

Pat Notz wrote:

> sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
> sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 2)
> NOTE: The last argument is "2" not "1" and not "True".  This is the
> bug in SocketServer -- the value is 1 which is wrong.

what strange platform are you using?

the SO_REUSEADDR option is defined as a "boolean" by all
socket implementations I've ever seen, where zero means
off, and any non-zero value means on.

the Standard Unix specification is even more explicit:

    "For boolean options, 0 indicates that the option is
    disabled and 1 indicates that the option is enabled."


More information about the Python-list mailing list