Index: /trunk/GnssCenter/thrift/test1/Makefile
===================================================================
--- /trunk/GnssCenter/thrift/test1/Makefile	(revision 4939)
+++ /trunk/GnssCenter/thrift/test1/Makefile	(revision 4939)
@@ -0,0 +1,33 @@
+
+BOOST_DIR  = /usr/include/boost
+THRIFT_DIR = /usr/local/include/thrift
+LIB_DIR    = /usr/local/lib
+DEFS       = -DHAVE_INTTYPES_H -DHAVE_NETINET_IN_H
+
+INC        = -I$(THRIFT_DIR) -I$(BOOST_DIR)
+
+GEN_SRC    = ./gen-cpp/myService.cpp \
+             ./gen-cpp/myservice_types.cpp ./gen-cpp/myservice_constants.cpp
+
+GEN_OBJ    = $(patsubst %.cpp,%.o, $(GEN_SRC))
+
+
+.PHONY: all clean
+
+all: gen-cpp server client
+
+gen-cpp: myservice.thrift
+	thrift -r -gen cpp myservice.thrift
+
+%.o: %.cpp
+	$(CXX) -Wall $(DEFS) $(INC) -c $< -o $@
+
+server: server.o $(GEN_OBJ)
+	$(CXX) $^ -o $@ -L$(LIB_DIR) -lthrift 
+
+client: client.o $(GEN_OBJ)
+	$(CXX) $^ -o $@ -L$(LIB_DIR) -lthrift 
+
+clean:
+	$(RM) *.o server client
+	$(RM) -R gen-cpp
Index: /trunk/GnssCenter/thrift/test1/client.cpp
===================================================================
--- /trunk/GnssCenter/thrift/test1/client.cpp	(revision 4939)
+++ /trunk/GnssCenter/thrift/test1/client.cpp	(revision 4939)
@@ -0,0 +1,38 @@
+#include <iostream>
+
+#include <thrift/protocol/TBinaryProtocol.h>
+#include <thrift/transport/TSocket.h>
+#include <thrift/transport/TTransportUtils.h>
+
+#include "gen-cpp/myService.h"
+
+using namespace std;
+using namespace boost;
+using namespace apache::thrift;
+using namespace apache::thrift::protocol;
+using namespace apache::thrift::transport;
+
+int main(int argc, char** argv) {
+  int port = 9090;
+  shared_ptr<TSocket>    socket(new TSocket("localhost", port));
+  shared_ptr<TTransport> transport(new TBufferedTransport(socket));
+  shared_ptr<TProtocol>  protocol(new TBinaryProtocol(transport));
+  myServiceClient        client(protocol);
+
+  try {
+    transport->open();
+
+    while (true) {
+      string answ;
+      client.answer(answ, "How are you?");
+      cout << "Server answers: " << answ << endl;
+      sleep(1);
+    }
+
+    transport->close();
+  } catch (TException& exc) {
+    cout << "Exception: " << exc.what() << endl;
+  }
+
+  return 0;
+}
Index: /trunk/GnssCenter/thrift/test1/myservice.thrift
===================================================================
--- /trunk/GnssCenter/thrift/test1/myservice.thrift	(revision 4939)
+++ /trunk/GnssCenter/thrift/test1/myservice.thrift	(revision 4939)
@@ -0,0 +1,4 @@
+
+service myService {
+   string answer(1:string question)
+}
Index: /trunk/GnssCenter/thrift/test1/server.cpp
===================================================================
--- /trunk/GnssCenter/thrift/test1/server.cpp	(revision 4939)
+++ /trunk/GnssCenter/thrift/test1/server.cpp	(revision 4939)
@@ -0,0 +1,39 @@
+#include <iostream>
+
+#include <thrift/protocol/TBinaryProtocol.h>
+#include <thrift/server/TSimpleServer.h>
+#include <thrift/transport/TServerSocket.h>
+#include <thrift/transport/TBufferTransports.h>
+
+#include "gen-cpp/myService.h"
+
+using namespace std;
+using namespace boost;
+using namespace ::apache::thrift;
+using namespace ::apache::thrift::protocol;
+using namespace ::apache::thrift::transport;
+using namespace ::apache::thrift::server;
+
+class myServiceHandler : virtual public myServiceIf {
+ public:
+  myServiceHandler() {}
+  void answer(std::string& answ, const std::string& question) {
+    cout << "Client asks: " << question << endl;
+    answ = "I am well, thanks.";
+  }
+};
+
+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());
+
+  TSimpleServer server(processor, serverTransport, 
+                       transportFactory, protocolFactory);
+  server.serve();
+  return 0;
+}
+
