Uploaded image for project: 'Qpid Proton'
  1. Qpid Proton
  2. PROTON-1706

pn_listener_t provide access to actual listening port

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: proton-c-0.18.1
    • Fix Version/s: proton-c-0.20.0
    • Component/s: proton-c
    • Labels:
      None

      Description

      Allow access to the actual listening port of a pn_listener_t so that the actual address is available when listening on port 0.

      Proposed API:

      /**
       * Get the listening addresses of a listener.
       * A listener can have more than one address for several reasons:
       * - DNS host records may indicate more than one address
       * - On a multi-homed host, listening on the default host "" will listen on all local addresses.
       * - Some IPv4/IPV6 configurations may expand a single address into a v4/v6 pair.
       *
       * @param l points to the listener
       * @param addrs an array of `pn_netaddr_t*` to be filled with pointers the listening addresses
       *  Pointers are invalid after the listener closes (PN_LISTENER_CLOSE event is handled)
       * @param len is the length of the array @p addrs
       * @return The actual number of addresses used for listening. This may be:
       *  - 0: addresses are unavailable.
       *  - <= @p len:  all addresses were copied to @p addrs, remaining entries were set to NULL.
       *  - > @p len: the first @p len addresses were copied to @p addr.
       *  `pn_netaddr_listen(l, NULL, 0)` returns the number of listening addresses.
       */
      PNP_EXTERN const size_t pn_netaddr_listen(pn_listener_t *l, pn_netaddr_t** addrs, size_t len);
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                aconway Alan Conway
                Reporter:
                aconway Alan Conway
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: