Subject: Re: socket callbacks

Re: socket callbacks

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 27 Jun 2012 15:35:46 +0200 (CEST)

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