majek / puka

Puka - the opinionated RabbitMQ client
https://github.com/majek/puka
Other
182 stars 34 forks source link

try connecting to all possible values returned from getaddrinfo #37

Open schmir opened 11 years ago

schmir commented 11 years ago

if getaddrinfo returns multiple values, we try to connect to each one until the first succeeds. we block while doing that, but we probably already did in getaddrinfo.

however if getaddrinfo returns exactly one value, we still use a nonblocking connect.

so, if someone want to make sure the connect function doesn't block, he can use a numeric IP address.