blob: 47ab69e85b082acabccb46f13296c3a839cd909a [file] [log] [blame]
Mark Sleee8540632006-05-30 09:24:40 +00001#ifndef T_SIMPLE_SERVER_H
2#define T_SIMPLE_SERVER_H
3
4#include "server/TServer.h"
5#include "transport/TServerTransport.h"
6
7/**
8 * This is the most basic simple server. It is single-threaded and runs a
9 * continuous loop of accepting a single connection, processing requests on
10 * that connection until it closes, and then repeating. It is a good example
11 * of how to extend the TServer interface.
12 *
13 * @author Mark Slee <mcslee@facebook.com>
14 */
15class TSimpleServer : public TServer {
16 public:
17 TSimpleServer(TDispatcher* dispatcher,
18 TServerOptions* options,
19 TServerTransport* serverTransport) :
20 TServer(dispatcher, options), serverTransport_(serverTransport) {}
21
22 ~TSimpleServer() {}
23
24 void run();
25
26 protected:
27 TServerTransport* serverTransport_;
28};
29
30#endif