Repository navigation
0.29.3: what a readiness enquiry held is delivered with the rest, by recv as by read; handles retired before they are closed - #91
Merged
Conversation
…recv as by read; handles retired before they are closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #52.
pollandselectanswer for a connection by taking one byte and holding it.readreturned that byte with whatever else had arrived (a read bounded by now);recv,recvfromandrecvmsgreturned the byte alone, so a program that polls before eachrecvtook a stream one byte per wakeup.okm_take_aheadplaces the held byte and reads what else has arrived behind it;do_readandokm_sock_recvboth call it, so a call that delivers the byte cannot leave the rest out. Datagram sockets are unchanged (the enquiry holds a whole message).examples/netsends a thousand bytes in one call and counts: throughpollandrecv, and throughpollandrecvmsgwith two buffers. Before: the firstrecvreturned 1 byte, 1000 calls for 1000 bytes, andrecvmsgreturned 1. After: 1000 in one call.