Server robustness fixes in Thrift C++ libs
Summary: ServerSockets can be interrupt() ed
Reviewed By: marc, karl
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665039 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/cpp/src/transport/TServerSocket.h b/lib/cpp/src/transport/TServerSocket.h
index e801f84..b482e02 100644
--- a/lib/cpp/src/transport/TServerSocket.h
+++ b/lib/cpp/src/transport/TServerSocket.h
@@ -33,6 +33,10 @@
void listen();
void close();
+ void interrupt() {
+ interrupt_ = true;
+ }
+
protected:
shared_ptr<TTransport> acceptImpl();
@@ -42,6 +46,7 @@
int acceptBacklog_;
int sendTimeout_;
int recvTimeout_;
+ volatile bool interrupt_;
};
}}} // facebook::thrift::transport