libp2p / go-reuseport

reuse tcp/udp ports in golang
ISC License
765 stars 108 forks source link

Enhancement: For FreeBSD based systems, enable connection load balancing in case of multiple listeners. #105

Open chaitanyaprem opened 1 year ago

chaitanyaprem commented 1 year ago

Enhancement

In linux based systems, setting SO_REUSEPORT socket option and binding multiple listening sockets enables kernel to perform connection load balancing onto all listeners. Whereas this is not implemented in windows and macOS.

But for FreeBSD based systems, an additional socket option called SO_REUSEPORT_LB has to be enabled in order for this load balancing to take place. It is described here.

Hence, this is an enhancement issue to enable this new option for freeBSD based systems.

marten-seemann commented 1 year ago

This sounds correct. @chaitanyaprem, do you want to submit a PR?

chaitanyaprem commented 1 year ago

This sounds correct. @chaitanyaprem, do you want to submit a PR?

Sure, I can. Don't have a way to test this though. Any suggestions?