Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I don't feel like this was given enough time:

> One option is to use SO_REUSEPORT and create multiple listen sockets sharing the same port number. This approach has problems though - when one of the file descriptors is closed, the sockets already waiting in the accept queue will be dropped

Yes, it's a problem if you use it across processes... but if you have a single long lived process with each thread listening on a separate queue, isn't that the simplest solution?



That process isn't allowed to fork, I assume, which is problematic.


I'm not proposing a fork either. Each thread would open a separate socket with the SO_REUSEPORT set. The kernel would then have a separate queue per socket.

Please correct me if I'm wrong.


I'm saying that none of those threads can start any programs. That may or not be required by your use-case, but it's certainly a disadvantage.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: