Changeset 4944 in ntrip


Ignore:
Timestamp:
Feb 23, 2013, 3:54:37 PM (11 years ago)
Author:
mervart
Message:
 
Location:
trunk/GnssCenter/thrift/test2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GnssCenter/thrift/test2/client.cpp

    r4942 r4944  
    1313using namespace apache::thrift::transport;
    1414
    15 class myServiceHandler : virtual public myServiceIf {
     15class myService : virtual public myServiceIf {
    1616 public:
    17   myServiceHandler() {}
     17  myService() {}
    1818  void answer(std::string& answ, const std::string& question) {
    1919    cout << "Server asks: " << question << endl;
     
    2525int main(int argc, char** argv) {
    2626  int port = 9090;
    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));
     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));
    3030
    31   shared_ptr<myServiceHandler> 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));
    3333
    3434  try {
  • trunk/GnssCenter/thrift/test2/server.cpp

    r4943 r4944  
    1616using namespace ::apache::thrift::server;
    1717
    18 class myServiceHandler : virtual public myServiceIf {
     18class myService : virtual public myServiceIf {
    1919 public:
    20   myServiceHandler() {}
     20  myService() {}
    2121  void answer(std::string& answ, const std::string& question) {
    2222    // implemented on the client-side only
     
    2727 public:
    2828  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;
    3233    return processor;
    3334  }
Note: See TracChangeset for help on using the changeset viewer.