| 302 | } |
| 303 | |
| 304 | bool IsPeekTimeoutTException(const TTransportException& e) { |
| 305 | // String taken from TSocket::peek() Thrift's TSocket.cpp and TSSLSocket.cpp. |
| 306 | return (e.getType() == TTransportException::UNKNOWN |
| 307 | && strstr(e.what(), "recv(): Resource temporarily unavailable") != nullptr) |
| 308 | || (e.getType() == TTransportException::TIMED_OUT |
| 309 | && strstr(e.what(), "THRIFT_POLL (timed out)") != nullptr); |
| 310 | } |
| 311 | |
| 312 | bool IsConnResetTException(const TTransportException& e) { |
| 313 | // Strings taken from TTransport::readAll(). This happens iff TSocket::read() returns 0. |