-- Allow manual setting of host and port in TSocket
Summary:
-- required for TSocketPool equivalent functionality
Reviewed By: slee
Notes:
-- Todo is to replicate TSocketPool.php in C++
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664912 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/cpp/src/transport/TSocket.h b/lib/cpp/src/transport/TSocket.h
index 8137984..3decb2c 100644
--- a/lib/cpp/src/transport/TSocket.h
+++ b/lib/cpp/src/transport/TSocket.h
@@ -28,11 +28,19 @@
* Constructs a new socket. Note that this does NOT actually connect the
* socket.
*
+ */
+ TSocket();
+
+ /**
+ * Constructs a new socket. Note that this does NOT actually connect the
+ * socket.
+ *
* @param host An IP address or hostname to connect to
* @param port The port to connect on
*/
TSocket(std::string host, int port);
+
/**
* Destroyes the socket object, closing it if necessary.
*/
@@ -73,6 +81,20 @@
void write(const uint8_t* buf, uint32_t len);
/**
+ * Set the host that socket will connect to
+ *
+ * @param host host identifier
+ */
+ void setHost(std::string host);
+
+ /**
+ * Set the port that socket will connect to
+ *
+ * @param port port number
+ */
+ void setPort(int port);
+
+ /**
* Controls whether the linger option is set on the socket.
*
* @param on Whether SO_LINGER is on