Rev 2 of Thrift, the Pillar successor
Summary: End-to-end communications and serialization in C++ is working
Reviewed By: aditya
Test Plan: See the new top-level test/ folder. It vaguely resembles a unit test, though it could be more automated.
Revert Plan: Revertible
Notes: Still a LOT of optimization work to be done on the generated C++ code, which should be using dynamic memory in a number of places. Next major task is writing the PHP/Java/Python generators.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664712 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/cpp/server/TSimpleServer.h b/lib/cpp/server/TSimpleServer.h
new file mode 100644
index 0000000..47ab69e
--- /dev/null
+++ b/lib/cpp/server/TSimpleServer.h
@@ -0,0 +1,30 @@
+#ifndef T_SIMPLE_SERVER_H
+#define T_SIMPLE_SERVER_H
+
+#include "server/TServer.h"
+#include "transport/TServerTransport.h"
+
+/**
+ * This is the most basic simple server. It is single-threaded and runs a
+ * continuous loop of accepting a single connection, processing requests on
+ * that connection until it closes, and then repeating. It is a good example
+ * of how to extend the TServer interface.
+ *
+ * @author Mark Slee <mcslee@facebook.com>
+ */
+class TSimpleServer : public TServer {
+ public:
+ TSimpleServer(TDispatcher* dispatcher,
+ TServerOptions* options,
+ TServerTransport* serverTransport) :
+ TServer(dispatcher, options), serverTransport_(serverTransport) {}
+
+ ~TSimpleServer() {}
+
+ void run();
+
+ protected:
+ TServerTransport* serverTransport_;
+};
+
+#endif