Hi,
thanks for the input!
"ares_set_sockopt_callback" seems like a good name.
I no one objects, let's decide on that name.
What did you have in mind for the opensocket cb? Anything I can fix while I am at the sockopt cb?
Br,
Fredrik
________________________________________
From: c-ares-bounces_at_cool.haxx.se [c-ares-bounces_at_cool.haxx.se] on behalf of Lijo Antony [lta_at_one.com]
Sent: Wednesday, June 27, 2012 16:14
To: c-ares_at_cool.haxx.se
Subject: Re: socket callbacks
On 06/27/2012 05:35 PM, Daniel Stenberg wrote:
>
> 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.
>
I think a name which makes the purpose explicit would be better.
Something like ares_set_socket_options_callback or
ares_set_sockopt_callback etc.
Distinction with existing "ares_set_socket_callback" would be more clear
as well. Also it would leave room for a future
"ares_set_opensocket_callback". (it's there in my to do list. Couldn't
work on it yet!). Similarity with curl callbacks(opensocket, sockopt)
would be an added advantage.
-lijo
Received on 2012-06-27