[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Dynamic selection for network service ports?

Markus Elfring <Markus.Elfring at web.de> writes:
> ...
>> You can avoid this with the SO_REUSEADDR flag.
> Can such a configuration parameter be used also together with
> programming interfaces from the module ?socketserver??

The "SO" prefix stands for "SOcket" -- "SO_REUSEADDR" is one of
many so called "socket option"s.
The name "socketserver" suggests that it is based on sockets.
Thus, it is highly likely that you can use "SO_REUSEADDR" together
with "socketserver" -- in one way or another.

In addition, it is very helpful to read the available documentation.

The "socketserver" documentation tells you that a "socketserver"
has the attribute "allow_reuse_address", described as:
"Whether the server will allow the reuse of an address.
This defaults to False, and can be set in subclasses to change the policy."

The choice of this attribute's name suggests that it was designed
to use the "SO_REUSEADDR" socket option internally to support
this frequent use case.