2014-04-19 18:24 GMT+02:00 Saúl Ibarra Corretgé <[email protected]>: > On 4/19/14 12:52 AM, Susheel Aroskar wrote: >> >> Hi, >> >> I assumed if I called uv_close on uv_tcp_t that has a read pending >> (registered by calling uv_read_start earlier) it will cause uv_read_cb >> to be invoked with nread < 0 to indicate an error. In my testing it does >> not behave like this. The socket gets closed, if there us any connect >> request pending on the same socket it's callback gets called, but if >> there is a read request pending it's callback is never called. Is this >> expected behavior? I even tried calling uv_read_stop before uv_close but >> that too doesn't help. Am I missing something? I'm running my code on >> Mac OS X (Maverick) >> > > If the socket was connected you'll get the read callback called with UV_EOF, > but not if it was never connected.
Mmm, that is not true. If you call uv_close(), even on a connected TCP handle, it does not fire a uv_read_cb with UV_EOF at all (that only happens if the peer closes its side of the TCP connection). -- 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.
