Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-30391

OneClientServer.port can be confusing with port=0 if listening on more than one socket

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      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.

        Attachments

          Activity

          Hide
          rowen Russell Owen added a comment -
          Show
          rowen Russell Owen added a comment - Pull request: https://github.com/lsst-ts/ts_tcpip/pull/3
          Hide
          rowen Russell Owen added a comment -

          Reviewed on github

          Show
          rowen Russell Owen added a comment - Reviewed on github
          Hide
          rowen Russell Owen added a comment -

          Released v0.2.0

          Show
          rowen Russell Owen added a comment - Released v0.2.0

            People

            Assignee:
            rowen Russell Owen
            Reporter:
            rowen Russell Owen
            Reviewers:
            Wouter van Reeven
            Watchers:
            Russell Owen, Te-Wei Tsai, Wouter van Reeven
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Jenkins

                No builds found.