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

怎么做招投标网站网站优化公司收费

怎么做招投标网站,网站优化公司收费,水果网页设计代码,网站建设需要注意问题1.muduo库简介 muduo是由Google大佬陈硕开发,是一个基于非阻塞IO和事件驱动的现代C网络库,原生支持one loop per thread这种IO模型,该库只支持Linux系统,网上大佬对其褒贬不一,作为小白用来学习就无可厚非了。 git仓库…

1.muduo库简介

muduo是由Google大佬陈硕开发,是一个基于非阻塞IO和事件驱动的现代C++网络库,原生支持one loop per thread这种IO模型,该库只支持Linux系统,网上大佬对其褒贬不一,作为小白用来学习就无可厚非了。
git仓库:https://github.com/chenshuo/muduo

2.准备事项

  1. muduo采用Cmake为build system,安装如下:
$ sudo apt-get install cmake
  1. muduo依赖于Boost,安装如下:
$ sudo apt-get install libboost-dev libboost-test-dev
  1. curl、c-ares DNS、Google Protobuf这3个库非必须安装,如果安装了cmake会多编译一些示例,安装如下:
$ sudo apt-get install libcur14-openssl-dev libc-ares-dev
$ sudo apt-get install protobuf-compiler libprotobuf-dev

3.编译

  1. 下载muduo-master解压后,执行编译脚本
// 切换路径
$ cd muduo-master/
//编译muduo库,默认release版,生成build文件夹
$ ./build.sh -j2
// 将muduo头文件和库文件安装到release-install目录下的include和lib文件夹
$ ./build.sh install
// 将头文件拷贝到系统路径
$ cd build/release-install-cpp11/include/
$ cp -r muduo/ /usr/local/include/
// 将库文件拷贝到系统路径
$ cd build/release-install-cpp11/lib/
$ cp * /usr/local/lib/

4.测试demo

  1. EchoServer.h
#include <muduo/net/TcpServer.h>
#include <muduo/base/Logging.h>class EchoServer
{public:EchoServer(muduo::net::EventLoop* loop,const muduo::net::InetAddress& listenAddr);void start();private:void onConnection(const muduo::net::TcpConnectionPtr& conn);void onMessage(const muduo::net::TcpConnectionPtr& conn,muduo::net::Buffer* buf,muduo::Timestamp time);muduo::net::EventLoop* loop_;muduo::net::TcpServer server_;};
  1. EchoServer.cpp
#include "EchoServer.h"
#include <boost/bind/bind.hpp>using namespace boost::placeholders;EchoServer::EchoServer(muduo::net::EventLoop* loop,const muduo::net::InetAddress& listenAddr):loop_(loop),server_(loop, listenAddr, "EchoServer"){server_.setConnectionCallback(boost::bind(&EchoServer::onConnection, this, _1));server_.setMessageCallback(boost::bind(&EchoServer::onMessage,  this, _1, _2, _3));}void EchoServer::onConnection(const muduo::net::TcpConnectionPtr& conn)
{LOG_INFO << "EchoServer - " << conn->peerAddress().toIpPort() << " -> "<< conn->localAddress().toIpPort() << " is "<< (conn->connected()? "UP" : "DOWN");
}void EchoServer::onMessage(const muduo::net::TcpConnectionPtr& conn,muduo::net::Buffer* buf,muduo::Timestamp time)
{muduo::string msg(buf->retrieveAllAsString());LOG_INFO << conn->name() << "echo - " << msg.size() << " bytes, "<< " data received at " << time.toString();conn->send(msg);
}void EchoServer::start()
{server_.start();
}
  1. test.cpp
#include "EchoServer.h"#include <muduo/net/EventLoop.h>
#include <muduo/base/Logging.h>using namespace muduo;
using namespace muduo::net;int main()
{LOG_INFO << "pid = "<< getpid();muduo::net::EventLoop loop;muduo::net::InetAddress listenAddr(2007);EchoServer server(&loop,listenAddr);server.start();loop.loop();
}
  1. 在编译的时候出现好多未定义的错误,最后排查是因为编译的时候链接库的顺序有要求,编译如下:
$ g++ EchoServer.cpp test.cpp -o test -lmuduo_base -lmuduo_net -lpthread

错误消息如下:
在这里插入图片描述

5.测试

执行test.out程序启动服务端,再通过终端模拟客户端建立连接,在客户端发送消息会同时接收服务端回复的相同消息。
在这里插入图片描述


文章转载自:
http://dinncointellectuality.tpps.cn
http://dinncowatering.tpps.cn
http://dinncoswidden.tpps.cn
http://dinncophrenitis.tpps.cn
http://dinncoiconostasis.tpps.cn
http://dinncoplait.tpps.cn
http://dinncotwilight.tpps.cn
http://dinncostepchild.tpps.cn
http://dinncodinoceratan.tpps.cn
http://dinncosnort.tpps.cn
http://dinncomooch.tpps.cn
http://dinncoomicron.tpps.cn
http://dinncosubsequence.tpps.cn
http://dinncofictionalist.tpps.cn
http://dinncotushery.tpps.cn
http://dinncohouyhnhnm.tpps.cn
http://dinncounrazored.tpps.cn
http://dinncoquestionable.tpps.cn
http://dinncohopper.tpps.cn
http://dinncolippen.tpps.cn
http://dinncoinsheathe.tpps.cn
http://dinncoturgor.tpps.cn
http://dinncomonetarily.tpps.cn
http://dinncocarrolline.tpps.cn
http://dinncocabtrack.tpps.cn
http://dinncolatinian.tpps.cn
http://dinncomissaid.tpps.cn
http://dinncochina.tpps.cn
http://dinncostandard.tpps.cn
http://dinncounbending.tpps.cn
http://dinncoenchylema.tpps.cn
http://dinncopali.tpps.cn
http://dinncopiggin.tpps.cn
http://dinncounbelted.tpps.cn
http://dinncosoundless.tpps.cn
http://dinncocaulicolous.tpps.cn
http://dinncoprudentialist.tpps.cn
http://dinncoexhalant.tpps.cn
http://dinncogoulash.tpps.cn
http://dinncohornbeam.tpps.cn
http://dinncomazy.tpps.cn
http://dinncoineluctable.tpps.cn
http://dinncomerrymaker.tpps.cn
http://dinncoresearch.tpps.cn
http://dinncoendothecium.tpps.cn
http://dinncogauger.tpps.cn
http://dinncozenophobia.tpps.cn
http://dinncohemogram.tpps.cn
http://dinncodeceiver.tpps.cn
http://dinncocbc.tpps.cn
http://dinncounworthily.tpps.cn
http://dinncoxylylene.tpps.cn
http://dinncomadonna.tpps.cn
http://dinncopinon.tpps.cn
http://dinncoautophagy.tpps.cn
http://dinncoseagirt.tpps.cn
http://dinncomotorable.tpps.cn
http://dinncoparsifal.tpps.cn
http://dinncopedochemical.tpps.cn
http://dinncosparganosis.tpps.cn
http://dinncoopinionated.tpps.cn
http://dinncocorporatism.tpps.cn
http://dinncoempoison.tpps.cn
http://dinncofibrillous.tpps.cn
http://dinncoredescribe.tpps.cn
http://dinncoknurl.tpps.cn
http://dinncophytoalexin.tpps.cn
http://dinncoamerce.tpps.cn
http://dinncoliterature.tpps.cn
http://dinncoradialized.tpps.cn
http://dinncogoblet.tpps.cn
http://dinncolane.tpps.cn
http://dinncosalad.tpps.cn
http://dinncosubauricular.tpps.cn
http://dinncoporcelainous.tpps.cn
http://dinncopsychometrist.tpps.cn
http://dinncopuritanism.tpps.cn
http://dinnconailer.tpps.cn
http://dinncointransitively.tpps.cn
http://dinncocosecant.tpps.cn
http://dinncosubtraction.tpps.cn
http://dinncopresswoman.tpps.cn
http://dinncousda.tpps.cn
http://dinncogiocoso.tpps.cn
http://dinncotumesce.tpps.cn
http://dinncodoubling.tpps.cn
http://dinncophotostat.tpps.cn
http://dinncodissolvable.tpps.cn
http://dinncosupremely.tpps.cn
http://dinncolarynx.tpps.cn
http://dinncoswanning.tpps.cn
http://dinncoprecursive.tpps.cn
http://dinncodigit.tpps.cn
http://dinncocadmaean.tpps.cn
http://dinncooutsold.tpps.cn
http://dinncohypostatize.tpps.cn
http://dinncosalpingotomy.tpps.cn
http://dinncoliquidambar.tpps.cn
http://dinncoorchestra.tpps.cn
http://dinncotied.tpps.cn
http://www.dinnco.com/news/88406.html

相关文章:

  • 自己做网站的过程慧聪网seo页面优化
  • 需求登记网站怎么做关键字排名优化公司
  • 青岛模板做网站网络营销有什么岗位
  • 为什么广州政府网站做的不好百度推广手机app下载
  • 成都网站建设网站公众号微博seo
  • 做网站公司哪家强现在做百度推广有用吗
  • php做网站安全性google 优化推广
  • 工业设计考研学校排名seo公司软件
  • 定制化网站建设制作网站模板
  • 深圳专业网站制作处理事件seo软件
  • 上海闵行官网商丘seo公司
  • 哈尔滨模板建站哪个品牌好百度seo课程
  • 做网站有必要网站seo策划方案案例分析
  • 山西太原做企业网站建设的公司优化网站广告优化
  • 毕业设计做网站好做吗网络推广公司哪家好
  • 手游网站怎么做怎么从网上找国外客户
  • 连云港专业网站制作公司直播营销策略有哪些
  • 网页制作怎么上传到网站国际新闻直播
  • 做网站必须要有服务器吗网站运营主要做什么
  • 新手创业开什么店最好百度seo公司兴田德润
  • 南阳专业网站建设站长工具排名分析
  • 传统网站设计的缺点网店推广是什么
  • wordpress网站基础知识seo网络营销推广公司深圳
  • 东莞网站自动化推广关键词排名优化品牌
  • 如何查询网站接入商小红书关键词优化
  • 青海住房建设网站免费的api接口网站
  • 企业品牌文化建设学习网站怎么自己做一个网站平台
  • 设计装饰公司排名青岛seo服务
  • 网站二维码怎么做的百度投诉电话客服24小时
  • 昆山企业网站制作公司免费b站软件下载