Skip to content

internal/socket: support MSG_DONTWAIT #108

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

Closed
wants to merge 1 commit into from

Conversation

matzf
Copy link
Contributor

@matzf matzf commented Jul 9, 2021

Explicitly handle MSG_DONTWAIT in read and send calls on platforms where this is defined, to get the per-call non-blocking behavior as would be expected when calling readmsg/sendmsg in C.
When MSG_DONTWAIT is set, we always return true from the function passed to syscall.RawConn.Read/Write, to avoid entering the polling state.

Fixes golang/go#46891

@google-cla google-cla bot added the cla: yes label Jul 9, 2021
@gopherbot
Copy link
Contributor

This PR (HEAD: d432032) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/net/+/333469 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Ian Lance Taylor:

Patch Set 1:

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/333469.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

This PR (HEAD: 4022e9b) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/net/+/333469 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Matthias Frei:

Patch Set 1:

(3 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/333469.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Ian Lance Taylor:

Patch Set 2: Run-TryBot+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/333469.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go Bot:

Patch Set 2:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/333469.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go Bot:

Patch Set 2:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/333469.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go Bot:

Patch Set 2: TryBot-Result-1

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/333469.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Ian Lance Taylor:

Patch Set 2: Code-Review+2

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/333469.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Damien Neil:

Patch Set 2: Code-Review+1 Trust+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/333469.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Damien Neil:

Patch Set 2: Run-TryBot+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/333469.
After addressing review feedback, remember to publish your drafts!

gopherbot pushed a commit that referenced this pull request Aug 5, 2021
Explicitly handle MSG_DONTWAIT in read and send calls on platforms where this is defined, to get the per-call non-blocking behavior as would be expected when calling readmsg/sendmsg in C.
When MSG_DONTWAIT is set, we always return true from the function passed to syscall.RawConn.Read/Write, to avoid entering the polling state.

Fixes golang/go#46891

Change-Id: I4809577477554db1c45b6f4825a03d98208199d7
GitHub-Last-Rev: 4022e9b
GitHub-Pull-Request: #108
Reviewed-on: https://go-review.googlesource.com/c/net/+/333469
Run-TryBot: Ian Lance Taylor <[email protected]>
Run-TryBot: Damien Neil <[email protected]>
Reviewed-by: Ian Lance Taylor <[email protected]>
Reviewed-by: Damien Neil <[email protected]>
Trust: Damien Neil <[email protected]>
@gopherbot
Copy link
Contributor

This PR is being closed because golang.org/cl/333469 has been merged.

@gopherbot gopherbot closed this Aug 5, 2021
@matzf matzf deleted the msgdontwait branch August 6, 2021 07:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

x/net/{ipv4,ipv6}: MSG_DONTWAIT flag ignored
2 participants