问题:
The man pages
and programmer documentations for the socket options SO_REUSEADDR
and SO_REUSEPORT
are different for different operating systems and often highly confusing. 套接字选项SO_REUSEADDR
和SO_REUSEPORT
的man pages
和程序员文档对于不同的操作系统是不同的,并且通常非常混乱。 Some operating systems don't even have the option SO_REUSEPORT
. 某些操作系统甚至没有SO_REUSEPORT
选项。 The WEB is full of contradicting information regarding this subject and often you can find information that is only true for one socket implementation of a specific operating system, which may not even be explicitly mentioned in the text. WEB中充满了关于此主题的矛盾信息,并且通常您可以找到仅对特定操作系统的一个套接字实现的信息,这些信息甚至可能在文本中没有明确提及。
So how exactly is SO_REUSEADDR
different than SO_REUSEPORT
? 那么SO_REUSEADDR
究竟与SO_REUSEPORT
有何不同?
Are systems without SO_REUSEPORT
more limited? 没有SO_REUSEPORT
系统是否更受限制?
And what exactly is the expected behavior if I use either one on different operating systems? 如果我在不同的操作系统上使用任何一个,那么预期的行为究竟是什么?
解决方案:
参考一: https://stackoom.com/question/yN9u/SO-REUSEADDR和SO-REUSEPORT有何不同参考二: https://oldbug.net/q/yN9u/How-do-SO-REUSEADDR-and-SO-REUSEPORT-differ
来源:oschina
链接:https://my.oschina.net/u/3797416/blog/4273122