Closed porsager closed 1 year ago
If spawning the child process before calling listen everything works as expected.
You typically do it this way. How fork works on different platforms is highly varying so you are always going to have differences if you don't follow the main usage (which is fork before listen)
If starting a child process after
listen
is called, this child process will somehow retain the port listened to, even after callingus_listen_socket_close
or exit of the parent app. This only seems to happen on macos, I've tested on linux, and haven't been able to replicate.Here is a reproducible sample
If spawning the child process before calling
listen
everything works as expected.