On Thu, Aug 11, 2016 at 6:50 PM Bishop Bettini <bis...@php.net> wrote:
> I feel the weight of new functions, but really getaddrinfo is meant to > both simplify and unify how sockets are dealt with in the modern era. > socket_getaddrinfo converts the returned linked list into an array of, > essentially, socket contexts. The user can inspect those contexts and > choose the one he wants to use in connect and bind. Simple. > > With a few minor tweaks to naming (to lump all the addrinfo functions > together), this makes sense to me: > > $contexts = socket_addrinfo_lookup($node, $service, $hints); > foreach ($contexts as $context) { > print_r(socket_addrinfo_explain($context)); > } > $socket = socket_addrinfo_connect($contexts[1]); > // ... > > So I would lean toward flavor #1. Thanks! > Bishop, Thanks, I was really thinking that #1 would be preferred over altering argument types to long-existing functions. I have updated the RFC to include only it's implementation as well as changed the function names. -- Dave