THRIFT-5248: Python: Make TSocket.isOpen check if server still connected
Client: py
This is inspired by changes to the Go library (THRIFT-5214) and, by
proxy, this blog post[1]. The idea is that if the other end of the
socket has closed their end of the connection, we can figure that out by
doing a non-blocking read on our socket before we waste time serializing
and sending a message just to find out the socket is closed when we try
to read the response.
[1]: https://github.blog/2020-05-20-three-bugs-in-the-go-mysql-driver/
diff --git a/lib/py/Makefile.am b/lib/py/Makefile.am
index c6c5ff3..b163057 100644
--- a/lib/py/Makefile.am
+++ b/lib/py/Makefile.am
@@ -50,6 +50,7 @@
$(PYTHON) test/thrift_json.py
$(PYTHON) test/thrift_transport.py
$(PYTHON) test/test_sslsocket.py
+ $(PYTHON) test/test_socket.py
$(PYTHON) test/thrift_TBinaryProtocol.py
$(PYTHON) test/thrift_TZlibTransport.py
$(PYTHON) test/thrift_TCompactProtocol.py