What about dup() the fd, then close the handle and open the duplicated fd with uv_tcp_open?
El mié., 3 jul. 2019 a las 8:06, Eugene Ostroukhov (<eostrouk...@gmail.com>) escribió: > I saw discussion here: https://github.com/libuv/libuv/issues/390 and it > looks like there's no universal way of transferring a handle between event > loops. > > Is there a way to close a handle without closing the file descriptor? > > What I want to do, is in Node.js code to get a handle from the main > context and pass it into the inspector background thread. This handle would > be something like a TCP socket or pipe - not a timer, async or such. It > looks like I can get FD from the main thread and then use uv_tcp_open or > alike on a background thread to "reopen" it. My main concern would be that > the main thread will still consider it open and I expect there will be some > issues. > > Any suggestions? > > -- > 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. > To view this discussion on the web visit > https://groups.google.com/d/msgid/libuv/af04cbf6-e3a3-43af-a08c-0fbbe9e2ae06%40googlegroups.com > <https://groups.google.com/d/msgid/libuv/af04cbf6-e3a3-43af-a08c-0fbbe9e2ae06%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/libuv/CAAJY-XM1k1HPTc65UHOEQcgC3vDwAXnKrCic2srkv2c32rpLqg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.