Github user nsuke commented on the pull request:
https://github.com/apache/thrift/pull/945#issuecomment-196013077
> I agree to obey the literal meaning of isOpen
To be clear, I'm not against introducing the feature you're suggesting,
I've just commented on the approach.
In fact, as you may have noticed, C++ has peek() method that does
"somewhat" similar thing.
> FYI, according to
http://code.activestate.com/recipes/408997-when-to-not-just-use-socketclose/#c5
:
It's same as the cases where read() returns 0 length, i.e. just plain old
EOF, so you still need to check the available data.
The urllib3 code you took is assuming that any remaining data is invalid
(it's true in their context).
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---