8 Star 109 Fork 32

secondtonone1 / boostasio-learn

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
contribute
Sync branch
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README
Zlib

简介

该项目为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 线程的基本操作,定义,启动,等待,以及后台运行等。
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.

About

boostasio学习笔记 expand collapse
C++ and 6 more languages
Zlib
Cancel

Releases

No release

Contributors

All

Activities

Load More
can not load any more
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/secondtonone1/boostasio-learn.git
git@gitee.com:secondtonone1/boostasio-learn.git
secondtonone1
boostasio-learn
boostasio-learn
master

Search

344bd9b3 5694891 D2dac590 5694891