cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Socket read and write functions

From: Colin <colin.hch_at_gmail.com>
Date: Wed, 21 Nov 2012 23:02:22 +0100

On Wed, Nov 21, 2012 at 10:51 PM, Daniel Stenberg <daniel_at_haxx.se> wrote:
> On Wed, 21 Nov 2012, Colin wrote:
>
>>> Can you elaborate on your use case?
>>
>> Imagine libcurl embedded in a large application that has a certain
>> infrastructure regarding logging and statistics etc. We would like to
>> instrument libcurl just above the socket in order to write a debug message
>> and feed the byte counters for every single read()/write() cal on the
>> socket, just as we do with other network operations for other protocols.
>
> For that, I'd refer you to CURLOPT_DEBUGFUNCTION ...

That seems to work, don't know why I missed it.

(Actually, now that I think about it, it seemed that with the
open/close/sockopt-functions there were many things in place required
to abstract away from the socket and give the application full control
over it, i.e. an application-supplied layer between libcurl and the
socket (or "socket"), so I was only looking in that direction; with
your remark about how many places of libcurl assume an actual socket
it is now clear that this kind of abstraction is not a current design
goal of libcurl, and therefore that what I was looking for might not
make much sense :-)

Thanks, Colin
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-11-21