Closed codetalks-new closed 7 years ago
@banxi1988 there's some conflicts because we've done some reversions to workaround bugs we were getting on linux w/ dispatch apis. Those branches are saved to add back in the future, but I'd like to understand this PR better and see if we can't get it in for our next release.
Can you elaborate a bit on how readn differs from read here?
Hi, in theory, the recv func without MSG_WAITALL flag may return before fully recv the specified number of bytes. so in sometimes I want to use readn func to ensure (or to wait) for all the required bytes.
@banxi1988 could you explain the use case for this method? If you want x amount of bytes why wouldn't you just call stream.read(max: x) ?
@banxi1988 we're starting beta tags, I think what you have could be additive, but if you could respond to Tanner's question and give a good explanation to us about what is additive about this, much appreciated 👍
@mjmsmith @tanner0101 Hi, I decide to close this PR, because,MSG_WAITALL socket options may be more suitable.
as TCP is a stream protocol, At many times, one data packet may be send within different segment. so a readn func would help us a lot. advices need to improve it.