On Fri, Jul 27, 2012 at 8:00 PM, Ben Noordhuis <[email protected]> wrote:
> On Fri, Jul 27, 2012 at 9:38 AM, Felix Halim <[email protected]> wrote:
>> Is it mandatory to call uv_close in the callback of uv_write?
>>
>> Or we can just write it like this (3 uv_writes, followed by one uv_close):
>>
>> uv_write(&write_req, (uv_stream_t*)&handle, &resbuf, 1, 0);
>> uv_write(&write_req, (uv_stream_t*)&handle, &resbuf, 1, 0);
>> uv_write(&write_req, (uv_stream_t*)&handle, &resbuf, 1, 0);
>> uv_close((uv_handle_t*)req->handle, on_close);
>>
>> Is it guaranteed that the close will happen after all writes are finished?
>>
>> I couldn't find any info regarding this in the uv.h
>>
>> Felix Halim
>
> The handle gets closed, your callbacks get called with status=-1,
> error code UV_EINTR. The data is not written.
>
> I'll add it to uv.h if it isn't documented there yet.


So, the only way to correctly call uv_close() is to wait until all
uv_write's callbacks have been called?

Why don't it get queued just like multiple_calls to uv_write() ?

(I am asking why it is designed that way)

Felix Halim

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to