当前位置: 首页 > news >正文

河南网站建设yijuce佛山网站建设全方位服务

河南网站建设yijuce,佛山网站建设全方位服务,网页设计尺寸标准,电脑网络优化软件thrift是一种常用rpc框架#xff0c;工作中经常会用到#xff0c;本文记录一下其安装过程。 目录 1.下载软件包 1.1thrift下载 1.2libevent下载 1.3boost下载 2.安装#xff08;注意步骤#xff09; 2.1安装libevent 2.2安装boost 2.3安装与Python2.7版本对应的py…thrift是一种常用rpc框架工作中经常会用到本文记录一下其安装过程。 目录 1.下载软件包 1.1thrift下载 1.2libevent下载 1.3boost下载 2.安装注意步骤 2.1安装libevent 2.2安装boost  2.3安装与Python2.7版本对应的python-dev 2.4安装Thrift 3.测试安装 1.下载软件包 1.1thrift下载 Apache Thrift - Downloadhttps://thrift.apache.org/download 1.2libevent下载 https://libevent.org/https://libevent.org/ 1.3boost下载 Boost C Librarieshttp://www.boost.org/%C2%A0 2.安装注意步骤 2.1安装libevent tar -zxvf libevent-2.1.12-stable.tar.gz  cd libevent-2.1.12-stable/ sudo ./configure --prefix/usr/local/libevent sudo make sudo make install 2.2安装boost  tar -zxvf boost_1_81_0_rc1.tar.gz  cd boost_1_81_0/ sudo ./bootstrap.sh --prefix/usr/local/boost sudo ./b2 sudo ./b2 install 2.3安装与Python2.7版本对应的python-dev sudo apt-get install python2.7-dev 2.4安装Thrift https://dlcdn.apache.org/thrift/0.18.1/thrift-0.18.1.tar.gz tar -zxvf thrift-0.18.1.tar.gz cd thrift-0.18.1 chmod x configure sudo ./configure --with-boost/usr/local/boost --prefix/usr/local/thrift sudo make sudo make install 查看thrift版本 /usr/local/thrift/bin/thrift -version 3.测试安装 以官网协议StressTest.thrift为例 /** Licensed to the Apache Software Foundation (ASF) under one* or more contributor license agreements. See the NOTICE file* distributed with this work for additional information* regarding copyright ownership. The ASF licenses this file* to you under the Apache License, Version 2.0 (the* License); you may not use this file except in compliance* with the License. You may obtain a copy of the License at** http://www.apache.org/licenses/LICENSE-2.0** Unless required by applicable law or agreed to in writing,* software distributed under the License is distributed on an* AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY* KIND, either express or implied. See the License for the* specific language governing permissions and limitations* under the License.*/namespace cpp test.stress namespace d thrift.test.stress namespace go stressservice Service {void echoVoid(),i8 echoByte(1: i8 arg),i32 echoI32(1: i32 arg),i64 echoI64(1: i64 arg),string echoString(1: string arg),listi8 echoList(1: listi8 arg),seti8 echoSet(1: seti8 arg),mapi8, i8 echoMap(1: mapi8, i8 arg), } //同步代码生成 /usr/local/thrift/bin/thrift -r --gen cpp StressTest.thrift  //异步代码生成 /usr/local/thrift/bin/thrift --gen cpp:cob_style StressTest.thrift  备注  //生成java代码 thrift -r --gen java student.thrift   //生成python代码 thrift -r --gen py student.thrift     client.cpp #include iostream #include string #include thrift/transport/TTransportUtils.h #include thrift/transport/TSocket.h #include thrift/protocol/TBinaryProtocol.h #include Service.husing namespace ::test::stress; using namespace apache::thrift; using namespace apache::thrift::protocol; using namespace apache::thrift::transport;int main() {std::shared_ptrTSocket socket(new TSocket(localhost, 9090));std::shared_ptrTTransport transport(new TFramedTransport(socket));std::shared_ptrTProtocol protocol(new TBinaryProtocol(transport));ServiceClient client(protocol);transport-open();std::cout client echoByte byte client.echoByte(A) std::endl;std::cout send_echoByte(B) std::endl;client.send_echoByte(B);std::cout send_echoByte(C) std::endl;client.send_echoByte(C);std::cout recv_echoByte() client.recv_echoByte() std::endl;std::cout recv_echoByte() client.recv_echoByte() std::endl;transport-close();return 0; } 客户端编译 g -stdc11 -I./gen-cpp -I/usr/local/thrift/include  -I/usr/local/libevent/include -I/usr/local/libevent/include/event2 -I/usr/local/boost/include  gen-cpp/Service.cpp  client.cpp -o client -L /usr/local/thrift/lib  -lthrift  -L /usr/local/libevent/lib -levent -L /usr/local/boost/lib -lboost_json 代码目录结构如下
http://www.hkea.cn/news/14430872/

相关文章:

  • 做设计那些网站可以卖设计图网站优惠券怎么做的
  • 做视频网站需要多大的带宽免费个人简历表
  • 针对人群不同 网站做细分免费可以做旅游海报 的网站
  • 网上商城网站建设意义郑州门户网站制作
  • 中国建设银行网站 路护航官网wap网站 劣势
  • 做网站空间要多大海珠五屏网站建设
  • 做手机网站的好处做影视网站赚钱
  • 3分钟搞定网站seo优化外链建设官方网站建设方法
  • 手机怎么注册自己的网站教育网站建设毕业设计说明书
  • 信息网站有哪些58同城网络营销
  • 淄博服装网站建设手机网站免费生成
  • 网站建设mfdos无极电影网安全吗
  • 网站有订单了有声音提醒怎么做丽水市城乡建设局网站
  • 雨花台网站建设北京东直门+网站建设
  • 贵州省网站建设选哪家哪里能找到网站
  • 做头像一个字的网站深圳航空公司官网
  • 电商网站的制作流程创建平台网站下载软件
  • dedecms网站关键词百度关键词搜索技巧
  • 网站建设需要上传数据库吗房地产公司基本介绍
  • 网站色彩学宁波市铁路建设指挥部网站
  • 郑州整形网站建设怎样做网页游戏网站
  • 网站开发概述建设银行朝阳支行网站
  • 网站流量多少做网盟优化大师win7
  • 建设企业网站哪家好WordPress一键采集插件
  • 只做网站的洛夕网站建设
  • 做网站什么码杭州做网站公司有哪些
  • 地税局网站建设情况汇报网站的结构设计
  • 安徽省交通建设工程质量监督局网站毕设网站建设论文
  • 企业网站策划案怎么写怎么知道一个网站的权重
  • 产品网站有哪些wordpress用户注册不通过邮箱验证