Hi folks!
I would like to know the correct way to pass the tcp handle of a connection to another thread that will read / write this handle.
The idea is, on the main thread, listen and accept new connections. These connections are validated using a handshake protocol on this same thread and if everything is ok, that connection is added to a queue that will be processed by another thread.
Currently in raw sockets I can simply pass the socket file descriptor between threads, but in libuv I've been seeing examples where it uses IPC pipes and uv_write2.
But in my case what I need to do is a inter-thread handle communication but not an inter-process communication.
I think that the boilerplate and overhead of ipc pipes, (listen, write, read ipc's) just to pass a handle within the same process should not be the correct approach ... or should it?
I would like to get your feedback.
Thank you!