blob: a0d22a76dfd8b702f1aa2e63e687a124ba2715a3 [file] [log] [blame]
Mark Sleed788b2e2006-09-07 01:26:35 +00001#ifndef _THRIFT_SERVER_TSIMPLESERVER_H_
2#define _THRIFT_SERVER_TSIMPLESERVER_H_ 1
Mark Sleee8540632006-05-30 09:24:40 +00003
4#include "server/TServer.h"
5#include "transport/TServerTransport.h"
6
Marc Slemko6f038a72006-08-03 18:58:09 +00007namespace facebook { namespace thrift { namespace server {
8
Mark Sleee8540632006-05-30 09:24:40 +00009/**
10 * This is the most basic simple server. It is single-threaded and runs a
11 * continuous loop of accepting a single connection, processing requests on
12 * that connection until it closes, and then repeating. It is a good example
13 * of how to extend the TServer interface.
14 *
15 * @author Mark Slee <mcslee@facebook.com>
16 */
17class TSimpleServer : public TServer {
18 public:
Marc Slemko16698852006-08-04 03:16:10 +000019 TSimpleServer(shared_ptr<TProcessor> processor,
Mark Sleed788b2e2006-09-07 01:26:35 +000020 shared_ptr<TServerTransport> serverTransport,
21 shared_ptr<TTransportFactory> transportFactory,
22 shared_ptr<TServerOptions> options) :
23 TServer(processor, serverTransport, transportFactory, options) {}
Mark Sleee8540632006-05-30 09:24:40 +000024
25 ~TSimpleServer() {}
26
Mark Slee794993d2006-09-20 01:56:10 +000027 void serve();
Mark Sleee8540632006-05-30 09:24:40 +000028
Mark Sleee8540632006-05-30 09:24:40 +000029};
30
Marc Slemko6f038a72006-08-03 18:58:09 +000031}}} // facebook::thrift::server
32
Mark Sleed788b2e2006-09-07 01:26:35 +000033#endif // #ifndef _THRIFT_SERVER_TSIMPLESERVER_H_