blob: 36f895ca18266e82db58e4ee752f11e92217cc54 [file] [log] [blame]
Bryan Duxburycd9aea12011-02-22 18:12:06 +00001// Copyright (c) 2009- Facebook
2// Distributed under the Thrift Software License
3//
4// See accompanying file LICENSE or visit the Thrift site at:
5// http://developers.facebook.com/thrift/
6
7#ifndef _THRIFT_TRANSPORT_TSSLSERVERSOCKET_H_
8#define _THRIFT_TRANSPORT_TSSLSERVERSOCKET_H_ 1
9
10#include <boost/shared_ptr.hpp>
11#include "TServerSocket.h"
12
13namespace apache { namespace thrift { namespace transport {
14
15class TSSLSocketFactory;
16
17/**
18 * Server socket that accepts SSL connections.
19 *
20 * @author Ping Li <pingli@facebook.com>
21 */
22class TSSLServerSocket: public TServerSocket {
23 public:
24 /**
25 * Constructor.
26 *
27 * @param port Listening port
28 * @param factory SSL socket factory implementation
29 */
30 TSSLServerSocket(int port, boost::shared_ptr<TSSLSocketFactory> factory);
31 /**
32 * Constructor.
33 *
34 * @param port Listening port
35 * @param sendTimeout Socket send timeout
36 * @param recvTimeout Socket receive timeout
37 * @param factory SSL socket factory implementation
38 */
39 TSSLServerSocket(int port, int sendTimeout, int recvTimeout,
40 boost::shared_ptr<TSSLSocketFactory> factory);
41 protected:
42 boost::shared_ptr<TSocket> createSocket(int socket);
43 boost::shared_ptr<TSSLSocketFactory> factory_;
44};
45
46}}}
47
48#endif