blob: 9e0f79f996e6b47485955fd077122a4e3883db4b [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:
Mark Slee8d7e1f62006-06-07 06:48:56 +000017 TSimpleServer(TProcessor* processor,
Mark Sleee8540632006-05-30 09:24:40 +000018 TServerOptions* options,
19 TServerTransport* serverTransport) :
Mark Slee8d7e1f62006-06-07 06:48:56 +000020 TServer(processor, options), serverTransport_(serverTransport) {}
Mark Sleee8540632006-05-30 09:24:40 +000021
22 ~TSimpleServer() {}
23
24 void run();
25
26 protected:
27 TServerTransport* serverTransport_;
28};
29
30#endif