2014-09-08 22:43 GMT+02:00 Fedor Indutny <[email protected]>:
> Hello!
>
> This is a good question indeed!
>
> In node.js we just slice that data right into bufs and increments the `bufs`
> pointer itself until the proper offset is reached.
>
> Here is a relevant section:
>
> https://github.com/joyent/node/blob/master/src/stream_wrap.cc#L616-L628
Useful!
Let me say anyhow that it is a bit hard, but being honest I cannot
figure out how to make it easier at API level. Well... what about if
uv_try_write() updates by itself the given buffers (so it removes
entirely written buffers form the array and modified the len field of
the first uncomplete buffer) and also nbufs (so the parameter should
be passed by reference)?:
int uv_try_write(uv_stream_t* handle,
const uv_buf_t bufs[],
unsigned int &nbufs);
--
Iñaki Baz Castillo
<[email protected]>
--
You received this message because you are subscribed to the Google Groups
"libuv" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/libuv.
For more options, visit https://groups.google.com/d/optout.