zgb40302 opened a new issue #1338:
URL: https://github.com/apache/incubator-brpc/issues/1338


   **Describe the bug (描述bug)**
   reuse_addr 选项没生效
   
   **To Reproduce (复现方法)**
   场景1:
   [root@localhost bin]# ./test --reuse_port=true --reuse_addr=false &
   I0126 17:19:43.666755 14773 /data1/incubator-brpc/src/brpc/server.cpp:1045] 
Server[Instance] is serving on port=3560.
   I0126 17:19:43.666857 14773 /data1/incubator-brpc/src/brpc/server.cpp:1048] 
Check out http://localhost.localdomain:35611 in web browser.
   
   [root@localhost bin]# 
   [root@localhost bin]# ./test --reuse_port=true --reuse_addr=false
   E0126 17:19:53.633741 15182 /data1/incubator-brpc/src/brpc/server.cpp:955] 
Fail to listen 0.0.0.0:3560
   error_msg "Start failed", at test.cpp:237, Address already in use  //  不能重用
   
   场景2:
   [root@localhost bin]# ./test --reuse_port=true &
   I0126 17:10:59.854588 30670 /data1/incubator-brpc/src/brpc/server.cpp:1045] 
Server[Instance] is serving on port=3560.
   I0126 17:10:59.854727 30670 /data1/incubator-brpc/src/brpc/server.cpp:1048] 
Check out http://localhost.localdomain:35611 in web browser.
   
   [root@localhost bin]# 
   [root@localhost bin]# ./test --reuse_port=true
   E0126 17:11:08.437747 31051 /data1/incubator-brpc/src/brpc/server.cpp:955] 
Fail to listen 0.0.0.0:3560
   error_msg "Start failed", at test.cpp:237, Address already in use   //  不能重用
   
   
   **Expected behavior (期望行为)**
   reuse_port可以生效
   
   **Versions (各种版本)**
   OS:    linux 3.10 
   Compiler: gcc
   brpc:    0.9.7
   protobuf:   3.6.1
   
   **Additional context/screenshots (更多上下文/截图)**
   无
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to