18 Star 276 Fork 72

secondtonone1/boostasio-learn

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
Zlib

简介

该项目为C++后端学习总结和分享,分为三大板块,基础,网络和并发。

Base

Base文件夹主要存储的是C++基础语法,目前在不断更新中

NetWork

网络模块主要采用boost::asio标准网络库完成封装和编写,涵盖如下内容,现将目录列举如下:

  • day01-endpoint 介绍了如何创建一个网络端点。

  • day02-iooperation 介绍了如何基于asio封装读写操作,包括同步和异步两种读写接口。

  • day03-SyncClient 介绍了如何封装一个同步的客户端。

  • day04-SyncServer 介绍了如何封装一个同步的服务器。

  • day05-AsyncServer 介绍了如何封装一个异步服务器,仅支持echo模式。

  • day06-AsyncServer 利用伪闭包实现连接保活,异步处理增加了全双工的通信模式,增加了缓冲队列,可以让用户无感知的方式发送数据,不用关心底层数据下发的逻辑了

  • day07-AsyncServer 增加粘包处理

  • day08-AsyncServer 增加逻辑处理大端小端的字节序问题,并且增加接收队列限制,防止队列溢出。

  • day09-ProtobufDemo 实现一个基于protobuf序列化的demo

  • day10-ProtobufServer 实现一个基于protobuf序列化的Server

  • day11-JsonServer 实现一个基于json序列化的Server

  • day12-MsgIdServer 完善数据包组织结构,结构更新为ID+LEN+数据域的格式

  • day13-LogicServer 增加逻辑层,包括逻辑队列和单例的逻辑类在独立的线程里异步处理请求。

  • day14-IocontextPoolServer 基于boost::asio实现多线程模式服务器,该模式实现了一个IocontextPool,每个Iocontext分布在一个线程里。

  • day15-ThreadPoolServer 基于线程池实现boost::asio多线程模式,该模式下多个线程共享同一个Iocontext

  • day16-HttpServer 基于boost::asio实现http server

  • day17-beast-http-server 基于beast网络库实现http服务器

  • day18-beast-websocket 基于beast网络库实现websocket服务器

  • day19-Grpc-Server 基于Grpc实现服务器,Grpc多用于后台内部服务。

  • day20-CoroutineDemo 基于boost::asio实现的协程server案例。

  • day21-CoroutineServer 将我们之前的服务器改写为协程

  • day22-AsyncLog 异步日志库

  • day23-producer-consumer 生产者消费者案例实现demo

Concurrent

该模块主要介绍并发编程技术, 主要更新完成了,目录后期补全

  • day01-thread 介绍C++11 线程的基本操作,定义,启动,等待,以及后台运行等。

赞赏

感谢支持

https://cdn.llfc.club/dashang.jpg

zlib License (C) 2023 secondtonone1 This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution.

简介

boostasio学习笔记 展开 收起
README
Zlib
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/secondtonone1/boostasio-learn.git
git@gitee.com:secondtonone1/boostasio-learn.git
secondtonone1
boostasio-learn
boostasio-learn
master

搜索帮助