workerman
workerman copied to clipboard
SO_REUSEPORT option. How a child process gets its own listening socket?
Hi!) I have a similar question, discussed here: https://github.com/walkor/Workerman/issues/156
I would like to understand how child process get it own listening socket. Master creates several listening sockets and then fork, after this each of workers inherits several sockets, and should close (decrease ref counter) all except one socket, and accept new connection from it? As a result all workers have independent queue for receiving request to connection?
When SO_REUSEPORT is true master will not create listening sockets, but each children process will create it's own listening socket.