You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Dynamic port selection and writing used port to external file #3
Selecting the port to use dynamically has two major benefits:
No need to have port open on registered port range.
Faster to launch remote servers sequentially when there's no need to wait ports to be free'ed. This happens to be needed in our acceptance tests and thus this feature is included into the 1.0 release.
This feature has three sides:
Actual implementation of selecting a port dynamically. This actually happens to be possible already now by explicitly using port 0. SimpleXMLRPCServer takes care of everything else.
Announcing the selected port so that users can easily check it and later connect to the right port. This will be implemented in two ways:
The already now printed message contains the actually used port, not the port that user gave.
Add feature to give the server a path to a file where to write the port number in use. This will be easy to use programmatically.
A problem with this change is that adding new port_file argument to the server before allow_stop argument is backwards-incompatible (bwic). I don't like the idea of adding it after allow_stop and thus think this small bwic problem is ok. It's anyway possible, and much more clear, to use allow_stop=False what works both before and after this change.
Activity
Announce selected port better.
pekkaklarck commentedon Jan 15, 2014
A problem with this change is that adding new
port_fileargument to the server beforeallow_stopargument is backwards-incompatible (bwic). I don't like the idea of adding it afterallow_stopand thus think this small bwic problem is ok. It's anyway possible, and much more clear, to useallow_stop=Falsewhat works both before and after this change.