thrift-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bgedik <>
Subject [GitHub] thrift pull request #1476: Remove premature call to workSocket() in TNonbloc...
Date Wed, 24 Jan 2018 18:44:19 GMT
Github user bgedik commented on a diff in the pull request:
    --- 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.


View raw message