qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (PROTON-1706) pn_listener_t provide access to actual listening port
Date Thu, 04 Jan 2018 18:04:00 GMT

    [ https://issues.apache.org/jira/browse/PROTON-1706?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16311758#comment-16311758
] 

ASF subversion and git services commented on PROTON-1706:
---------------------------------------------------------

Commit 7bc25c6117350f55572c0b628c9f9fd29d68c7d9 in qpid-proton's branch refs/heads/master
from [~aconway]
[ https://git-wip-us.apache.org/repos/asf?p=qpid-proton.git;h=7bc25c6 ]

PROTON-1706: pn_listener_t provide access to actual listening port

pn_netaddr_listening() provides list of pn_netaddr_t addresses for a listener.

Implemented in all proactors: epoll, libuv, iocp
Updated C tests to listen on port 0 for safe, portable dynamic port allocation.


> pn_listener_t provide access to actual listening port
> -----------------------------------------------------
>
>                 Key: PROTON-1706
>                 URL: https://issues.apache.org/jira/browse/PROTON-1706
>             Project: Qpid Proton
>          Issue Type: Improvement
>          Components: proton-c
>    Affects Versions: proton-c-0.18.1
>            Reporter: Alan Conway
>            Assignee: Alan Conway
>             Fix For: proton-c-0.20.0
>
>
> 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:
> {code}
> /**
>  * 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);
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


Mime
View raw message