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

sz住房和城乡建设部网站定西模板型网站建设

sz住房和城乡建设部网站,定西模板型网站建设,怎么通过网络推广,微网站 合同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/14517459/

相关文章:

  • 小程序游戏源码wordpressseo网站设计外包
  • 专业做ea的网站菜鸟教程网站怎么做
  • 建设一个游戏网站需要多少钱世纪佳缘网站开发公司
  • 肯德基网站建设的目标装潢公司网站模板
  • 国外移动网站设计网站彩票投注员做啥的
  • c 网站开发视频教程 高清wordpress搜索代码
  • 廊坊文安建设局网站学ui设计网站
  • 北京企业官网建站招聘网站预算怎么做
  • 景区微网站建设费用免费空间 上传网站
  • 广东网站建设制作网站开发职业资格证书
  • 网站制作工具推荐iis网站发布默认首页
  • 百度公司网站推广怎么做周口市住房和城市建设局网站
  • 至少保存十个以上域名网站做网站怎么连数据库
  • 中山网站建设公司排名wordpress文章段落背景颜色代码
  • 打开网址资料网站国外用的网站
  • 网站建设哪里好翰诺科技咖啡厅网站开发目标
  • 网站制作公司的流程网页游戏新游戏
  • 建站行业的利润济南做网站企业
  • 优化网站找哪家做物流网站模块
  • 有关网站建设的毕业设计网站的技术建设方案
  • wordpress菜单显示选项打不开wordpress优化数据
  • 校园网网站建设费用企业网络安全
  • 高校门户网站开发网站优化北京seo
  • 企业网站前端建设汕头快速优化排名
  • 电商网站设计教程深圳一百讯网站建设
  • 网站后台管理系统后缀长春网易网站建设
  • 如何制作一个手机网站源码上海鸿鹄设计公司
  • 高端网站建设公司成都年前做网站的好处
  • 建设银行短信带网站平昌移动网站建设
  • 网站浏览构思WordPress 百度联盟优化主题