SPRESENSE commented on code in PR #9647:
URL: https://github.com/apache/nuttx/pull/9647#discussion_r1331235398


##########
net/socket/socket.c:
##########
@@ -93,23 +94,50 @@ int psock_socket(int domain, int type, int protocol,
   psock->s_conn   = NULL;
   psock->s_type   = type & SOCK_TYPE_MASK;
 
-  /* Get the socket interface */
+#ifdef CONFIG_NET_USRSOCK
+  /* Get the usrsock interface */
 
-  sockif = net_sockif(domain, psock->s_type, psock->s_proto);
-  if (sockif == NULL)
+  sockif = &g_usrsock_sockif;
+  psock->s_sockif = sockif;
+
+  ret = sockif->si_setup(psock);
+
+  /* When usrsock daemon returns -EPROTONOSUPPORT, it means to use
+   * kernel's network stack, so fallback to kernel socket.
+   */
+
+  if (ret == -ENOSYS || ret == -ENOSUP)

Review Comment:
   @xiaoxiang781216 san
   Thank you for your suggestion!
   I applied it for this PR.
   Could you review this PR again?



-- 
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-unsubscr...@nuttx.apache.org

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

Reply via email to