THRIFT-756. cpp: Exposing TSocket(int) constructor to public
This patch changes the raw socket handle constructor from protected to public.
Patch: Rajat Goel
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@991785 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/cpp/src/transport/TSocket.cpp b/lib/cpp/src/transport/TSocket.cpp
index ce1ddcb..5da33bb 100644
--- a/lib/cpp/src/transport/TSocket.cpp
+++ b/lib/cpp/src/transport/TSocket.cpp
@@ -127,7 +127,7 @@
void TSocket::openConnection(struct addrinfo *res) {
if (isOpen()) {
- throw TTransportException(TTransportException::ALREADY_OPEN);
+ return;
}
socket_ = socket(res->ai_family, res->ai_socktype, res->ai_protocol);
@@ -235,7 +235,7 @@
void TSocket::open() {
if (isOpen()) {
- throw TTransportException(TTransportException::ALREADY_OPEN);
+ return;
}
// Validate port number