On Mon, Jul 24, 2017 at 7:29 PM, Charles Anthony <charles.unix....@gmail.com> wrote: > On Monday, July 24, 2017 at 1:12:54 AM UTC-7, Ben Noordhuis wrote: >> Libuv in general doesn't touch the .data field. Seeing that >> uv__stream_destroy() is in the call stack, it would seem that you >> called uv_close() on the handle. > > Okay; that makes some sense. It is possible that the sequence of events was > open connection > process calling open connection is interrupted, calls close connection > close connection tears down the data sturcure and calls uv_close > > If that is the path, then my on_connect callback can check for data == NULL, > and assume that the everything has been torn down if so. > > It's not clear why uv_close would be invoking on_connect tho.
Libuv always invokes outstanding callbacks on close, in order to let the user clean up. If you close a stream handle, it invokes pending connect, write and shutdown callbacks with status == UV_ECANCELED. -- 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 libuv+unsubscr...@googlegroups.com. To post to this group, send email to libuv@googlegroups.com. Visit this group at https://groups.google.com/group/libuv. For more options, visit https://groups.google.com/d/optout.