THRIFT-900. cpp: Unix domain socket
This patch adds a new Unix Socket transport.
Patch: Roger Meier
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1002179 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/cpp/src/transport/TSocket.h b/lib/cpp/src/transport/TSocket.h
index 0184362..f69a9a1 100644
--- a/lib/cpp/src/transport/TSocket.h
+++ b/lib/cpp/src/transport/TSocket.h
@@ -60,6 +60,14 @@
TSocket(std::string host, int port);
/**
+ * Constructs a new Unix domain socket.
+ * Note that this does NOT actually connect the socket.
+ *
+ * @param path The Unix domain socket e.g. "/tmp/ThriftTest.binary.thrift"
+ */
+ TSocket(std::string path);
+
+ /**
* Destroyes the socket object, closing it if necessary.
*/
virtual ~TSocket();
@@ -217,6 +225,9 @@
/** Port number to connect on */
int port_;
+ /** UNIX domain socket path */
+ std::string path_;
+
/** Underlying UNIX socket handle */
int socket_;
@@ -246,6 +257,10 @@
/** Whether to use low minimum TCP retransmission timeout */
static bool useLowMinRto_;
+
+ private:
+ void unix_open();
+ void local_open();
};
}}} // apache::thrift::transport