From ce8e36fd0aad3530db7b51f3a4cdd2b6984bc013 Mon Sep 17 00:00:00 2001 From: Sandman-Lisa Date: Wed, 14 Mar 2018 10:59:21 +0800 Subject: [PATCH] Lisa_task1 --- client.cpp | 8 ++++---- server.cpp | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/client.cpp b/client.cpp index d1a077e..86242b6 100644 --- a/client.cpp +++ b/client.cpp @@ -10,14 +10,14 @@ using namespace ::apache::thrift::protocol; using namespace ::apache::thrift::transport; using namespace ::apache::thrift::server; using namespace std; -using boost::shared_ptr; +//using boost::shared_ptr; using namespace ::myrpc::thrift; int main(){ - boost::shared_ptr socket(new TSocket("localhost", 9090)); - boost::shared_ptr transport(new TBufferedTransport(socket)); - boost::shared_ptr protocol(new TBinaryProtocol(transport)); + std::shared_ptr socket(new TSocket("localhost", 9090)); + std::shared_ptr transport(new TBufferedTransport(socket)); + std::shared_ptr protocol(new TBinaryProtocol(transport)); HeapSortClient client(protocol); transport->open(); diff --git a/server.cpp b/server.cpp index 186a81c..2f9a942 100644 --- a/server.cpp +++ b/server.cpp @@ -14,7 +14,7 @@ using namespace ::apache::thrift::protocol; using namespace ::apache::thrift::transport; using namespace ::apache::thrift::server; -using boost::shared_ptr; +//using boost::shared_ptr; using namespace ::myrpc::thrift; class HeapSortHandler : virtual public HeapSortIf { @@ -68,11 +68,11 @@ class HeapSortHandler : virtual public HeapSortIf { int main(int argc, char **argv) { int port = 9090; - shared_ptr handler(new HeapSortHandler()); - shared_ptr processor(new HeapSortProcessor(handler)); - shared_ptr serverTransport(new TServerSocket(port)); - shared_ptr transportFactory(new TBufferedTransportFactory()); - shared_ptr protocolFactory(new TBinaryProtocolFactory()); + std::shared_ptr handler(new HeapSortHandler()); + std::shared_ptr processor(new HeapSortProcessor(handler)); + std::shared_ptr serverTransport(new TServerSocket(port)); + std::shared_ptr transportFactory(new TBufferedTransportFactory()); + std::shared_ptr protocolFactory(new TBinaryProtocolFactory()); TSimpleServer server(processor, serverTransport, transportFactory, protocolFactory); server.serve();