On 09/08/2014 10:41 PM, Iñaki Baz Castillo wrote: > Hi, > > int uv_try_write(uv_stream_t* handle, > const uv_buf_t bufs[], > unsigned int nbufs); > > Let's suppose I provide the call with 2 buffers so nbufs is 2. The > first one has 100 bytes and the second one has 50 bytes. > > Then the function return 75, or 125. How am I supposed to react on > that in order to attempt to use uv_write()? >
Buffers are written in order, so you just need to get the position in the buffer and possibly build a new one. Here is how Node does it: https://github.com/joyent/node/blob/master/src/stream_wrap.cc#L613-L631 Cheers, -- Saúl Ibarra Corretgé bettercallsaghul.com
signature.asc
Description: OpenPGP digital signature
