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

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

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

PROTON-1470: proactor api - composing and examining addresses

Simpler solution than proposed in the JIRA.

No change to connect()/listen() signatures, they still take a string address.

Added pn_proactor_addr() to format an address string from a separate host and
port, so user does not need to know the format.

Format is simple "host:port", where the port is the substring after the *last*
":". IPv6 hosts are not decorated with "[]", the last ":" in the address is
always the host/port separator, never part of an IPv6 literal.

The C examples now take separate host, port arguments and use pn_proactor_addr()
to construct the proactor address. Existing bindings do not need to be changed,
but it would be good practice to have them use pn_proactor_addr() rather than
hard-coding the "host:port"format.

Also renamed pn_proactor_addr_t to pn_netaddr_t.


> proactor api - flexible, parse-free addressing
> ----------------------------------------------
>
>                 Key: PROTON-1470
>                 URL: https://issues.apache.org/jira/browse/PROTON-1470
>             Project: Qpid Proton
>          Issue Type: Bug
>          Components: proton-c
>    Affects Versions: 0.17.0
>            Reporter: Alan Conway
>            Assignee: Alan Conway
>             Fix For: 0.18.0
>
>
> pn_proactor_connect and listen take a const char* string as the network 
> address. This creates ambiguity about what the string means. URLs are complex 
> to parse and construct and pn_url_t has been deprecated because it does not 
> follow the URL standards well. Ad-hoc string formats like "host:port" are 
> confusing since IPv6 host addresses can contains ":" characters.
> Provide a simple pn_netaddr_t that can
> - provide a unquoted, separate host and port strings to connect and listen
> - inspect incoming addresses as standard struct sockaddr
> - get a readable, but not parsable, string from any network address
> - is extensible, in a binary compatible way, to support other address types 
> for connect/listen in future
> Note it is not a requirement (yet) to be able to connect/listen using an 
> arbitrary sockaddr but it should be possible to add such support in future in 
> a source and binary compatible way.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to