Index: /trunk/GnssCenter/thrift/test2/Makefile
===================================================================
--- /trunk/GnssCenter/thrift/test2/Makefile	(revision 4942)
+++ /trunk/GnssCenter/thrift/test2/Makefile	(revision 4943)
@@ -24,8 +24,8 @@
 
 server: server.o $(GEN_OBJ)
-	$(CXX) $^ -o $@ -L$(LIB_DIR) -lthrift 
+	$(CXX) $^ -o $@ -L$(LIB_DIR) -lthrift
 
 client: client.o $(GEN_OBJ)
-	$(CXX) $^ -o $@ -L$(LIB_DIR) -lthrift 
+	$(CXX) $^ -o $@ -L$(LIB_DIR) -lthrift
 
 clean:
Index: /trunk/GnssCenter/thrift/test2/server.cpp
===================================================================
--- /trunk/GnssCenter/thrift/test2/server.cpp	(revision 4942)
+++ /trunk/GnssCenter/thrift/test2/server.cpp	(revision 4943)
@@ -3,5 +3,5 @@
 
 #include <thrift/protocol/TBinaryProtocol.h>
-#include <thrift/server/TSimpleServer.h>
+#include <thrift/server/TThreadedServer.h>
 #include <thrift/transport/TServerSocket.h>
 #include <thrift/transport/TBufferTransports.h>
@@ -19,21 +19,16 @@
  public:
   myServiceHandler() {}
-  void answer(std::string& /* answ */, const std::string& /* question */) {
+  void answer(std::string& answ, const std::string& question) {
     // implemented on the client-side only
   }
 };
 
-class myServerEventHandler : virtual public TServerEventHandler {
+class myProcessorFactory : virtual public TProcessorFactory {
  public:
-  myServerEventHandler() {};
-  virtual void* createContext(shared_ptr<TProtocol> input,
-                              shared_ptr<TProtocol> output) {
-    void* context = TServerEventHandler::createContext(input, output);
-    cout << "createContext " << context << endl;
-
-    string* str = static_cast<string*>(context);
-    cout << "str = " << str << endl;
-
-    return context;
+  myProcessorFactory() {};
+  shared_ptr<TProcessor> getProcessor(const TConnectionInfo& info) {
+    shared_ptr<myServiceHandler> handler(new myServiceHandler());
+    shared_ptr<TProcessor>       processor(new myServiceProcessor(handler));
+    return processor;
   }
 };
@@ -41,17 +36,14 @@
 int main(int argc, char **argv) {
   int port = 9090;
-  shared_ptr<myServiceHandler>  handler(new myServiceHandler());
-  shared_ptr<TProcessor>        processor(new myServiceProcessor(handler));
-  shared_ptr<TServerSocket>     serverTransport(new TServerSocket(port));
-  shared_ptr<TTransportFactory> transportFactory(new TBufferedTransportFactory());
-  shared_ptr<TProtocolFactory>  protocolFactory(new TBinaryProtocolFactory());
+  shared_ptr<TServerSocket>      serverTransport(new TServerSocket(port));
+  shared_ptr<myProcessorFactory> processorFactory(new myProcessorFactory());
+  shared_ptr<TTransportFactory>  transportFactory(new TBufferedTransportFactory());
+  shared_ptr<TProtocolFactory>   protocolFactory(new TBinaryProtocolFactory());
 
-  TSimpleServer server(processor, serverTransport, 
-                       transportFactory, protocolFactory);
-
-  shared_ptr<TServerEventHandler> eventHandler(new myServerEventHandler());
-  server.setServerEventHandler(eventHandler);
+  TThreadedServer server(processorFactory, serverTransport,
+                         transportFactory, protocolFactory);
 
   server.serve();
+
   return 0;
 }
