Details
-
Type:
Story
-
Status: Done
-
Resolution: Done
-
Fix Version/s: None
-
Component/s: None
-
Labels:
-
Story Points:1
-
Epic Link:
-
Sprint:TSSW Sprint - May 24 - Jun 07
-
Team:Telescope and Site
-
Urgent?:No
Description
If you construct OneClientServer with port=0 then it picks a random port (per socket it listens on) and sets the port attribute to the port of the first of those sockets. Unfortunately if you set host=None then it typically listens to two sockets (one IP4 and one IP6) and the selected port is randomly chosen between those, which can be very confusing.
Improve this situation as follows:
- Add the family constructor argument to allow constraining the server to IP4 or IP6. Default it to IP4 since that's what we use (for now). By doing so, port=None will result in a single socket.
- Leave port=0 if the server listens on more than one socket.
- Document what's going on.
- Rename the connect_callback attribute to __connect_callback to make it easier to inherit from OneClientServer and change the example in the user guide to do that.
Pull request: https://github.com/lsst-ts/ts_tcpip/pull/3