chriskohlhoff / asio

Asio C++ Library
http://think-async.com/Asio
4.72k stars 1.19k forks source link

Set SO_REUSEPORT on Linux if available #1455

Open stephanlachnit opened 3 months ago

stephanlachnit commented 3 months ago

Closes https://github.com/chriskohlhoff/asio/issues/106.

Since Linux 3.9 the SO_REUSEPORT option is also available. This allows for e.g. to use several UDP sockets listening to the same broadcasts within a process.

I'm not sure if it would be better to add a asio::socket_base::reuse_port instead, since one might want to set one but not the other.