Hi,
I'd like to open voting on my RFC[1] to implement getaddrinfo(). The RFC
implements 4 new socket extension functions to aid in the calling,
examining, and connect/binding of the addrinfo structure.
--
Dave
I'd like to open voting on my RFC[1] to implement getaddrinfo(). The RFC
implements 4 new socket extension functions to aid in the calling,
examining, and connect/binding of the addrinfo structure.
+1 from me -- let the OS do the lookups.
Would you please add example usage and output of socket_addrinfo_explain to
the RFC, as that'll drive documentation creation?
Also, it may be beneficial to elaborate on the scenarios where
socket_addrinfo is easier to use than socket_* and friends (getservbyname
for example) and the costs of that ease (eg, behind the scenes DNS queries).
Also, it may be beneficial to elaborate on the scenarios where
socket_addrinfo is easier to use than socket_* and friends (getservbyname
for example) and the costs of that ease (eg, behind the scenes DNS queries).
Most of the getby network related functions are all pretty much wrapped
around IPv4 at the transport layer, for example gethostbyname.
Specifically[1] there are comments that explain how to implement in
userland a gethostbyname6 for IPv6 related lookups.
getaddrinfo, and it's inverse getnameinfo, are more modern network
interfaces to POSIX that allow us to develop with (generally) transport
layer agnostic.
As to a specific example case: if I accept user input to connect to a
remote site (bear with me here on security implications), I shouldn't need
to know if the remote site is v4, or v6 specific. Maybe we're doing a
down-detector site and the user input was ipv6.facebook.com, which has no A
record, but does have a AAAA record. It's cleaner and easier to just let
getaddrinfo figure it out for you.
--
Dave
[1] - http://php.net/manual/en/function.gethostbyname.php#70936
I'd like to open voting on my RFC[1] to implement getaddrinfo(). The
RFC implements 4 new socket extension functions to aid in the calling,
examining, and connect/binding of the addrinfo structure.
Sorry, I missed this discussion. Is there a reason why addrinfo is a
resource, and not an object? I realize resources are needed for the
actual socket, but is it needed for the addrinfo information?
I would also like to see (in the RFC, but certainly in the docs), how
this works connecting to a specific IPv6 address resource.
cheers,
Derick
I'd like to open voting on my RFC[1] to implement getaddrinfo(). The
RFC implements 4 new socket extension functions to aid in the calling,
examining, and connect/binding of the addrinfo structure.Sorry, I missed this discussion. Is there a reason why addrinfo is a
resource, and not an object? I realize resources are needed for the
actual socket, but is it needed for the addrinfo information?I would also like to see (in the RFC, but certainly in the docs), how
this works connecting to a specific IPv6 address resource.cheers,
Derick
I did message internals a couple weeks back about it, was limited
discussion so it was probably missed.
I will be adding the _explain example for bishop, and can add an IPv6
example for you too.
I went with a resource as addrinfo is itself a structure, which has general
information including a pointer to the actual sockaddr to use. I,
maybe preemptively, assumed the general use-case would be to use the
addrinfo for the sockaddr rather than the general hint-information returned
as well. As one ought not to care about how I can connect as long as libc
says it should work. And if you had a specific family, or protocol you
wanted to connect over, you can always provide the hint to get at it.
--
Dave
Hi,
I'd like to open voting on my RFC[1] to implement getaddrinfo(). The RFC
implements 4 new socket extension functions to aid in the calling,
examining, and connect/binding of the addrinfo structure.--
Dave
Hi,
RFC vote has finished. Was accepted 9-0 for PHP 7.2.
Thanks to all for discussion & voting. Would someone with vcs be able to
merge into master (or wherever it would need to go for 7.2)
Dave
I'd like to open voting on my RFC[1] to implement getaddrinfo(). The RFC
implements 4 new socket extension functions to aid in the calling,
examining, and connect/binding of the addrinfo structure.RFC vote has finished. Was accepted 9-0 for PHP 7.2.
Thanks to all for discussion & voting. Would someone with vcs be able to
merge into master (or wherever it would need to go for 7.2)
I have merged the PR into master (what's indeed the proper branch for
7.2), and also adjusted the RFC accordingly.
Thanks for the RFC and the implementation, Dave!
--
Christoph M. Becker