[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [Libevent-users] evhttp client error handling






On Thu, Nov 15, 2012 at 2:32 AM, Patrick Pelletier <ppelletier@xxxxxxxxxx> wrote:
[...] 
Not sure what the proper solution is for this, though.  I'm not enough of a sockets expert.  Although I'm curious why we need to create the socket before we've looked up the name.  If we looked up the name first, then we could create the socket with the proper address family in the first place.

My first thought would be that binding before doing the name lookup isn't going to work: we need to find out what address family we're going to connect to before we can find out what address family we're going to bind to?

Or alternatively, if we have already bound to a socket, we need to limit our name lookup to the address family we bound to.  If we've bound to 127.0.0.1, there's no point in doing an AF_UNSPEC name lookup -- we can only connect to AF_INET addresses in that case.


-- 
Nick