You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/12/18 13:47:23 UTC

[GitHub] [incubator-nuttx] anchao opened a new pull request #5030: sim/usrsock: reuse the socket address to avoid bind timeout

anchao opened a new pull request #5030:
URL: https://github.com/apache/incubator-nuttx/pull/5030


   
   ## Summary
   
   sim/usrsock: reuse the socket address to avoid bind timeout 
   
   Signed-off-by: chao.an <an...@xiaomi.com>
   
   ## Impact
   
   native socket
   
   ## Testing
   
   vnc test


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] anchao commented on a change in pull request #5030: sim/usrsock: reuse the socket address to avoid bind timeout

Posted by GitBox <gi...@apache.org>.
anchao commented on a change in pull request #5030:
URL: https://github.com/apache/incubator-nuttx/pull/5030#discussion_r771850064



##########
File path: arch/sim/src/sim/up_usrsock_host.c
##########
@@ -238,6 +239,7 @@ int usrsock_host_socket(int domain, int type, int protocol)
       return -errno;
     }
 
+  setsockopt(ret, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt));

Review comment:
       done




-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 merged pull request #5030: sim/usrsock: reuse the socket address to avoid bind timeout

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged pull request #5030:
URL: https://github.com/apache/incubator-nuttx/pull/5030


   


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] anchao commented on a change in pull request #5030: sim/usrsock: reuse the socket address to avoid bind timeout

Posted by GitBox <gi...@apache.org>.
anchao commented on a change in pull request #5030:
URL: https://github.com/apache/incubator-nuttx/pull/5030#discussion_r771828108



##########
File path: arch/sim/src/sim/up_usrsock_host.c
##########
@@ -238,6 +239,7 @@ int usrsock_host_socket(int domain, int type, int protocol)
       return -errno;
     }
 
+  setsockopt(ret, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt));

Review comment:
       this is mainly to solve the nuttx abnormal exit and fails to shutdown the socket fd,
   the usage of native socket is a little special, not all applications reuse the address in the userspace




-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #5030: sim/usrsock: reuse the socket address to avoid bind timeout

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #5030:
URL: https://github.com/apache/incubator-nuttx/pull/5030#discussion_r771827508



##########
File path: arch/sim/src/sim/up_usrsock_host.c
##########
@@ -238,6 +239,7 @@ int usrsock_host_socket(int domain, int type, int protocol)
       return -errno;
     }
 
+  setsockopt(ret, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt));

Review comment:
       why the user doesn't call setsockopt with SO_REUSEADDR by self and then let usrsock forward the request to host side?




-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #5030: sim/usrsock: reuse the socket address to avoid bind timeout

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #5030:
URL: https://github.com/apache/incubator-nuttx/pull/5030#discussion_r771835155



##########
File path: arch/sim/src/sim/up_usrsock_host.c
##########
@@ -238,6 +239,7 @@ int usrsock_host_socket(int domain, int type, int protocol)
       return -errno;
     }
 
+  setsockopt(ret, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt));

Review comment:
       Ok, it's reasonable. How about add a comment in the source code?




-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org