THRIFT-151. cpp: TSSLServerSocket and TSSLSocket implementation

This patch adds an implementation of the above ssl sockets.

Patch: Ping Li, Kevin Worth, Rowan Kerr

git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1073441 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/cpp/src/transport/TSSLServerSocket.h b/lib/cpp/src/transport/TSSLServerSocket.h
new file mode 100644
index 0000000..36f895c
--- /dev/null
+++ b/lib/cpp/src/transport/TSSLServerSocket.h
@@ -0,0 +1,48 @@
+// Copyright (c) 2009- Facebook
+// Distributed under the Thrift Software License
+//
+// See accompanying file LICENSE or visit the Thrift site at:
+// http://developers.facebook.com/thrift/
+
+#ifndef _THRIFT_TRANSPORT_TSSLSERVERSOCKET_H_
+#define _THRIFT_TRANSPORT_TSSLSERVERSOCKET_H_ 1
+
+#include <boost/shared_ptr.hpp>
+#include "TServerSocket.h"
+
+namespace apache { namespace thrift { namespace transport {
+
+class TSSLSocketFactory;
+
+/**
+ * Server socket that accepts SSL connections.
+ *
+ * @author Ping Li <pingli@facebook.com>
+ */
+class TSSLServerSocket: public TServerSocket {
+ public:
+  /**
+   * Constructor.
+   *
+   * @param port    Listening port
+   * @param factory SSL socket factory implementation
+   */
+  TSSLServerSocket(int port, boost::shared_ptr<TSSLSocketFactory> factory);
+  /**
+   * Constructor.
+   *
+   * @param port        Listening port
+   * @param sendTimeout Socket send timeout
+   * @param recvTimeout Socket receive timeout
+   * @param factory     SSL socket factory implementation
+   */
+  TSSLServerSocket(int port, int sendTimeout, int recvTimeout,
+                   boost::shared_ptr<TSSLSocketFactory> factory);
+ protected:
+  boost::shared_ptr<TSocket> createSocket(int socket);
+  boost::shared_ptr<TSSLSocketFactory> factory_;
+};
+
+}}}
+
+#endif