cpp: Add setLowRTO to TSocket
low tcp RTO might mitigate TCP incast problems. Adding the setLowRTO
function to TSocket allows us to experiment with a solution.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@920685 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/cpp/src/transport/TSocket.h b/lib/cpp/src/transport/TSocket.h
index b0f445a..b9d1c01 100644
--- a/lib/cpp/src/transport/TSocket.h
+++ b/lib/cpp/src/transport/TSocket.h
@@ -22,6 +22,7 @@
#include <string>
#include <sys/time.h>
+#include <netdb.h>
#include "TTransport.h"
#include "TServerSocket.h"
@@ -182,6 +183,15 @@
**/
int getPeerPort();
+ /**
+ * Sets whether to use a low minimum TCP retransmission timeout.
+ */
+ static void setUseLowMinRto(bool useLowMinRto);
+
+ /**
+ * Gets whether to use a low minimum TCP retransmission timeout.
+ */
+ static bool getUseLowMinRto();
protected:
/**
@@ -234,6 +244,9 @@
/** Recv timeout timeval */
struct timeval recvTimeval_;
+
+ /** Whether to use low minimum TCP retransmission timeout */
+ static bool useLowMinRto_;
};
}}} // apache::thrift::transport