Commit c824aca9 authored by wangxuefeng's avatar wangxuefeng

Jump back to root dir.

parent 445b444e
......@@ -13,7 +13,7 @@ env:
install:
- sudo apt-get install -qq realpath libgflags-dev libprotobuf-dev libprotoc-dev protobuf-compiler libleveldb-dev libgoogle-perftools-dev libboost-dev libssl-dev
- sudo apt-get install libgtest-dev && cd /usr/src/gtest && sudo env "PATH=$PATH" cmake . && sudo make && sudo mv libgtest* /usr/lib/ && cd -
- wget http://www.us.apache.org/dist/thrift/0.9.3/thrift-0.9.3.tar.gz && tar -xvf thrift-0.9.3.tar.gz && cd thrift-0.9.3/ && ./configure --prefix=/usr --with-ruby=no --with-python=no --with-java=no --with-go=no --with-perl=no --with-php=no --with-csharp=no --with-erlang=no --with-lua=no --with-nodejs=no && make && sudo make install
- wget http://www.us.apache.org/dist/thrift/0.9.3/thrift-0.9.3.tar.gz && tar -xvf thrift-0.9.3.tar.gz && cd thrift-0.9.3/ && ./configure --prefix=/usr --with-ruby=no --with-python=no --with-java=no --with-go=no --with-perl=no --with-php=no --with-csharp=no --with-erlang=no --with-lua=no --with-nodejs=no && make && sudo make install && cd -
script:
- sh build_in_travis_ci.sh
......@@ -6,24 +6,18 @@
#include <iostream>
using namespace apache::thrift;
using namespace apache::thrift::protocol;
using namespace apache::thrift::transport;
using namespace example;
int main(int argc, char **argv) {
boost::shared_ptr<TSocket> socket(new TSocket("127.0.0.1", 8019));
boost::shared_ptr<TTransport> transport(new TFramedTransport(socket));
boost::shared_ptr<TProtocol> protocol(new TBinaryProtocol(transport));
std::shared_ptr<apache::thrift::TSocket> socket(new apache::thrift::TSocket("127.0.0.1", 8019));
std::shared_ptr<apache::thrift::transport::TTransport> transport(new apache::thrift::transport::TFramedTransport(socket));
std::shared_ptr<apache::thrift::protocol::TProtocol> protocol(new apache::thrift::protocol::TBinaryProtocol(transport));
EchoServiceClient client(protocol);
example::EchoServiceClient client(protocol);
transport->open();
EchoRequest req;
example::EchoRequest req;
req.data = "hello";
EchoResponse res;
example::EchoResponse res;
client.Echo(res, req);
std::cout << "Res: " << res.data << std::endl;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment