Github user bgedik commented on a diff in the pull request:
https://github.com/apache/thrift/pull/1476#discussion_r163640014
--- Diff: lib/cpp/src/thrift/transport/TSSLSocket.h ---
@@ -78,6 +78,7 @@ class TSSLSocket : public TSocket {
bool peek();
void open();
void close();
+ bool hasPendingDataToRead();
--- End diff --
@jeking3 You said it would be preferable to have one way to ask, "is there
any data I can read" that does not block. I completely agree. But the existing
``peek`` method is not designed to be non-blocking. So I have a few choices
here:
* Update the doxygen comment of ``peek`` to reflect what it does and keep
``hasPendingDataToRead``
* Add an optional argument to peek that says ``nonBlocking=false`` and if
it is provided as ``true``, do what ``hasPendingDataToRead`` used to do and
remove ``hasPendingDataToRead``.
* Change ``peek`` to be always non-blocking.
How about #2 above? I think #3 is not easy, as it will require code changes
in other places that I am not comfortable with.
---