return value of uv_write vs int status of uv_write callback?

189 views
Skip to first unread message

Egor Egorov

unread,
Oct 24, 2013, 9:06:33 AM10/24/13
to li...@googlegroups.com
Hello. 

What is the absolute right way to make sure that uv_write has been finished successfully? I see that first I have to check that uv_write() did return 0. Then I have to check that status==0 in callback. 

Is that correct? 

Saúl Ibarra Corretgé

unread,
Oct 24, 2013, 9:28:58 AM10/24/13
to li...@googlegroups.com
Yes. If uv_write returned 0 it means the write request has been queued
and the callback will be called later with the status code. If uv_write
returns -1, however, the request wasn't queued at all and the callback
won't be called.

--
Sa�l Ibarra Corretg�
http://bettercallsaghul.com
Reply all
Reply to author
Forward
0 new messages