Subject: RE: socket callbacks

RE: socket callbacks

From: Fredrik Jansson <fredrik.jansson_at_columbitech.com>
Date: Wed, 27 Jun 2012 14:07:16 +0000

I assume you want that so that you can set some options before connect() is
done?

That is correct, I need to register the socket to make sure the connect will come through.

I will go ahead and implement suggestion 1 then.

Thanks for you input!

Best regards,
Fredrik
________________________________________
From: c-ares-bounces_at_cool.haxx.se [c-ares-bounces_at_cool.haxx.se] on behalf of Daniel Stenberg [daniel_at_haxx.se]
Sent: Wednesday, June 27, 2012 15:35
To: c-ares hacking
Subject: Re: socket callbacks

On Wed, 27 Jun 2012, Fredrik Jansson wrote:

> I am interested in using the ares lib but would need an additional socket
> callback, one that is called right after socket creation before the socket
> is configured and connected.

I assume you want that so that you can set some options before connect() is
done?

> Suggestion 1, I add a ares_set_socket_created_callback that takes the same
> parameters as ares_set_socket_callback.
>
> Suggestion 2, I rename ares_set_socket_callback to
> ares_set_socket_connected_callback, I believe that would be more informative
> name when there are two socket callbacks.
>
> Thoughts/opinions on this?

Number 2 is out of the question since that would break the ABI, so I say
option 1. The difference between these two callbacks (and possibly why) should
be clearly spelled out in the docs so that users won't get confused.

--
  / daniel.haxx.se
Received on 2012-06-27