Changeset 4944 in ntrip for trunk/GnssCenter/thrift/test2
- Timestamp:
- Feb 23, 2013, 3:54:37 PM (12 years ago)
- Location:
- trunk/GnssCenter/thrift/test2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GnssCenter/thrift/test2/client.cpp
r4942 r4944 13 13 using namespace apache::thrift::transport; 14 14 15 class myService Handler: virtual public myServiceIf {15 class myService : virtual public myServiceIf { 16 16 public: 17 myService Handler() {}17 myService() {} 18 18 void answer(std::string& answ, const std::string& question) { 19 19 cout << "Server asks: " << question << endl; … … 25 25 int main(int argc, char** argv) { 26 26 int port = 9090; 27 shared_ptr<TSocket> 28 shared_ptr<TTransport> 29 shared_ptr<TProtocol> 27 shared_ptr<TSocket> socket(new TSocket("localhost", port)); 28 shared_ptr<TTransport> transport(new TBufferedTransport(socket)); 29 shared_ptr<TProtocol> protocol(new TBinaryProtocol(transport)); 30 30 31 shared_ptr<myService Handler> handler(new myServiceHandler());32 shared_ptr<TProcessor> processor(new myServiceProcessor(handler));31 shared_ptr<myService> service(new myService()); 32 shared_ptr<TProcessor> processor(new myServiceProcessor(service)); 33 33 34 34 try { -
trunk/GnssCenter/thrift/test2/server.cpp
r4943 r4944 16 16 using namespace ::apache::thrift::server; 17 17 18 class myService Handler: virtual public myServiceIf {18 class myService : virtual public myServiceIf { 19 19 public: 20 myService Handler() {}20 myService() {} 21 21 void answer(std::string& answ, const std::string& question) { 22 22 // implemented on the client-side only … … 27 27 public: 28 28 myProcessorFactory() {}; 29 shared_ptr<TProcessor> getProcessor(const TConnectionInfo& info) { 30 shared_ptr<myServiceHandler> handler(new myServiceHandler()); 31 shared_ptr<TProcessor> processor(new myServiceProcessor(handler)); 29 shared_ptr<TProcessor> getProcessor(const TConnectionInfo& info) { 30 shared_ptr<myService> service(new myService()); 31 shared_ptr<TProcessor> processor(new myServiceProcessor(service)); 32 cout << "connection " << endl; 32 33 return processor; 33 34 }
Note:
See TracChangeset
for help on using the changeset viewer.