New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
net/usrsock: Add flags to sendto/recvfrom in usrsock #1443
Conversation
@@ -172,6 +172,7 @@ static int do_sendto_request(FAR struct usrsock_conn_s *conn, | |||
|
|||
req.head.reqid = USRSOCK_REQUEST_SENDTO; | |||
req.usockid = conn->usockid; | |||
req.flags = flags; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please submit the related patch to:
apps/examples/usrsocktest/
apps/wireless/gs2200m/
apps/netutils/usrsock_rpmsg/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I'll push them later.
@@ -376,9 +377,13 @@ ssize_t usrsock_sendto(FAR struct socket *psock, FAR const void *buf, | |||
goto errout_unlock; | |||
} | |||
|
|||
/* MSG_DONTWAIT is only use in usrsock. */ | |||
|
|||
flags &= ~MSG_DONTWAIT; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we need handle DONTWAIT like NONBLOCK flag?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, we need it.
@@ -397,9 +399,13 @@ ssize_t usrsock_recvfrom(FAR struct socket *psock, FAR void *buf, size_t len, | |||
|
|||
usrsock_setup_datain(conn, inbufs, ARRAY_SIZE(inbufs)); | |||
|
|||
/* MSG_DONTWAIT is only use in usrsock. */ | |||
|
|||
flags &= ~MSG_DONTWAIT; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we need handle DONTWAIT like NONBLOCK flag?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we need it.
please add comiit message with the commit description |
Add flags argument into sendto() and recvfrom() APIs for MSG_* flags can handling in the daemon. However, MSG_DONTWAIT should process in usrsock, so it unnecessary to pass to the daemon like O_NONBLOCK.
1e34422
to
31b0a80
Compare
@jerpelea I added the commit message. Could you please review this? |
@SPRESENSE Thanks for adding the commit message |
LGTM. |
Summary
Add flags argument to sendto/recvfrom interface in usrsock.
Impact
Testing
Tested by spresense:wifi