SO_REUSEPORT on linux

后端 未结 5 1949
有刺的猬
有刺的猬 2021-02-05 13:28

I want to know if SO_REUSEPORT option is enabled in LINUX 2.6 or not ??

If I try to use it and compile my code I get following error

01.c:72: error: `SO_         


        
5条回答
  •  我寻月下人不归
    2021-02-05 13:53

    Try this:

    #ifdefined (SO_REUSEPORT)
    ... set this option
    #endif
    

    Some platforms (OS/X for one) need this to be set if you're e.g. binding multiple UDP listeners to one port.

提交回复
热议问题