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 22:29:43 +0100

On Wed, Nov 21, 2012 at 9:39 PM, Daniel Stenberg <daniel_at_haxx.se> wrote:
> On Wed, 21 Nov 2012, Colin wrote:
>
>> there are no equivalents for read and write. Are there any specific
>> reasons to not include them and/or could they be easily added?
>
> We've not had anyone ask for such functions or presented a valid use-case
> for when such functions would indeed be needed. As lots of internals in
> libcurl assume and only work with actual *sockets* I can't think of very
> many cases where you want to provide your own functions to read or write
> from sockets.
>
> 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.

> But no, I don't think it has to be very difficult to add such functions.

Good ;-)

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