Skip to content
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

Merged
merged 1 commit into from Jul 29, 2020

Conversation

SPRESENSE
Copy link
Contributor

Summary

Add flags argument to sendto/recvfrom interface in usrsock.

Impact

Testing

Tested by spresense:wifi

@@ -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;
Copy link
Contributor

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/

Copy link
Contributor Author

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;
Copy link
Contributor

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?

Copy link
Contributor Author

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;
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we need it.

@jerpelea
Copy link
Contributor

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.
@SPRESENSE
Copy link
Contributor Author

@jerpelea I added the commit message. Could you please review this?

@jerpelea
Copy link
Contributor

jerpelea commented Jul 29, 2020

@SPRESENSE Thanks for adding the commit message

@xiaoxiang781216
Copy link
Contributor

LGTM.

@jerpelea jerpelea merged commit d2f7546 into apache:master Jul 29, 2020
@btashton btashton added this to To-Add in Release Notes - 10.0.0 Oct 14, 2020
@btashton btashton moved this from To-Add to Added in Release Notes - 10.0.0 Oct 19, 2020
@SPRESENSE SPRESENSE deleted the add-flags-sendto-recvfrom branch November 1, 2022 06:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants