All Projects → yuesong-feng → 30dayMakeCppServer

yuesong-feng / 30dayMakeCppServer

Licence: other
30天自制C++服务器,包含教程和源代码

Programming Languages

C++
36643 projects - #6 most used programming language
python
139335 projects - #7 most used programming language
CMake
9771 projects

Projects that are alternatives of or similar to 30dayMakeCppServer

Zserver4d
ZServer4D 是一套从商业项目剥离而出的云服务器中间件,可以承载百万级的分布式负载服务,并且支持IoT及内网穿透
Stars: ✭ 199 (-53.94%)
Mutual labels:  socket, epoll
Hp Socket
High Performance TCP/UDP/HTTP Communication Component
Stars: ✭ 4,420 (+923.15%)
Mutual labels:  socket, epoll
epoller
epoll implementation for connections in Linux, MacOS and Windows
Stars: ✭ 58 (-86.57%)
Mutual labels:  socket, epoll
Zeus
A high performance, cross-platform Internet Communication Engine. Developed with native socket API. Aim at handling millions of concurrent connections.
Stars: ✭ 30 (-93.06%)
Mutual labels:  socket, epoll
Socket.core
This is a socket framework based on C # net standard2.0 write, can be used for .NET Framework / dotnet core assembly, can run in window (IOCP) / linux (epoll) .Use asynchronous connection, asynchronous send, asynchronous receive, Performance burst tables, and pass the stress test. 这是一个基于C# .net standard2.0 写的socket框架,可使用于.net Framework/dotnet core程序集,能在window(IOCP)/linux(epoll)运行.使用异步连接,异步发送,异步接收,性能爆表,并且通过压力测试。
Stars: ✭ 203 (-53.01%)
Mutual labels:  socket, epoll
lce
linux网络编程框架(C++)基于Reactor事件机制,支持线程池,异步非阻塞,高并发,高性能
Stars: ✭ 61 (-85.88%)
Mutual labels:  socket, epoll
Tiginx
Tiginx is a Shanzhai Nginx project , please buyao use it xian , if meet problem , I no fuze ...
Stars: ✭ 29 (-93.29%)
Mutual labels:  socket, epoll
DatagramTunneler
Simple C++ cross-platform client/server app forwarding UDP datagrams through a TCP connection.
Stars: ✭ 116 (-73.15%)
Mutual labels:  socket
quick-net
This is a top level socket library, making servers and clients EASY!
Stars: ✭ 15 (-96.53%)
Mutual labels:  socket
LittleDrawBoard AN
基于socket实现的pc端和android端同步绘画板_ANDROID源码
Stars: ✭ 30 (-93.06%)
Mutual labels:  socket
freebind
IPv4 and IPv6 address rate limiting evasion tool
Stars: ✭ 88 (-79.63%)
Mutual labels:  socket
tunnel
一款单线程、轻量级和高性能的内网穿透程序,支持TCP流量转发(支持所有TCP上层协议,包括HTTP,SSH等),支持多客户端同时连接
Stars: ✭ 39 (-90.97%)
Mutual labels:  epoll
Picamera
基于树莓派的图传监控系统
Stars: ✭ 22 (-94.91%)
Mutual labels:  socket
TweetMigration
A WebGL heatmap of global Twitter activity
Stars: ✭ 42 (-90.28%)
Mutual labels:  socket
Stone
A Swift framework for connecting to Phoenix Channels in your iOS app (with Presence support).
Stars: ✭ 18 (-95.83%)
Mutual labels:  socket
Socketify
Raw TCP and UDP Sockets API on Desktop Browsers
Stars: ✭ 67 (-84.49%)
Mutual labels:  socket
sol
Lightweight MQTT broker, written from scratch. IO is handled by a super simple event loop based upon the most common IO multiplexing implementations.
Stars: ✭ 72 (-83.33%)
Mutual labels:  epoll
game net
Unity游戏和C++服务器 socket通信demo, 数据格式采用google protobuf
Stars: ✭ 53 (-87.73%)
Mutual labels:  socket
dystopia
Low to medium multithreaded Ubuntu Core honeypot coded in Python.
Stars: ✭ 59 (-86.34%)
Mutual labels:  socket
ws2s
ws2s(websocket to socket)--bring socket to browser-side js.
Stars: ✭ 50 (-88.43%)
Mutual labels:  socket

30天自制C++服务器

教程的配套网络库:pine,star and fork!

先说结论:不管使用什么语言,一切后台开发的根基,是面向Linux的C/C++服务器开发。

几乎所有高并发服务器都是运行在Linux环境的,笔者之前也用Java、node写过服务器,但最后发现只是学会了一门技术、一门语言,而并不了解底层的基础原理。一个HTTP请求的过程,为什么可以实现高并发,如何控制TCP连接,如何处理好数据传输的逻辑等等,这些只有面向C/C++编程才能深入了解。

本教程模仿《30天自制操作系统》,面向零经验的新手,教你在30天内入门Linux服务器开发。本教程更偏向实践,将会把重点放在如何写代码上,而不会花太多的篇幅讲解背后的计算机基础原理,涉及到的地方会给出相应书籍的具体章节,但这并不代表这些理论知识不重要,事实上理论基础相当重要,没有理论的支撑,构建出一个高性能服务器是无稽之谈。

本教程希望读者:

  • 熟悉C/C++语言
  • 熟悉计算机网络基础,如TCP协议、socket原理等
  • 了解基本的操作系统基础概念,如进程、线程、内存资源、系统调用等

学完本教程后,你将会很轻松地看懂muduo源码。

C/C++学习的一个难点在于初学时无法做出实际上的东西,没有反馈,程序都在黑乎乎的命令行里运行,不像web开发,可以随时看到自己学习的成果。本教程的代码都放在code文件夹里,每一天学习后都可以得到一个可以编译运行的服务器,不断迭代开发。

在code文件夹里有每一天的代码文件夹,进入该文件夹,使用make命令编译,会生成两个可执行文件,输入命令./server就能看到今天的学习成果!然后新建一个Terminal,然后输入./client运行客户端,与服务器交互。

day01-从一个最简单的socket开始

day02-不要放过任何一个错误

day03-高并发还得用epoll

day04-来看看我们的第一个类

day05-epoll高级用法-Channel登场

day06-服务器与事件驱动核心类登场

day07-为我们的服务器添加一个Acceptor

day08-一切皆是类,连TCP连接也不例外

day09-缓冲区-大作用

day10-加入线程池到服务器

day11-完善线程池,服务器成型,写测试程序

day12-将服务器改写为主从Reactor多线程模式

day13-C++工程化、代码分析、性能优化

day14-支持业务逻辑自定义、完善Connection类

day15-macOS、FreeBSD支持

todo list:

定时器

日志系统

HTTP协议支持

webbench测试

......

Contribute

能力一般、水平有限,如果发现我的教程有不正确或者值得改进的地方,欢迎提issue或直接PR。

欢迎大家为本项目贡献自己的代码,如果有你觉得更好的代码,请提issue或者直接PR,所有建议都会被考虑。

贡献代码请到pine项目,这是本教程开发的网络库,也是最新的代码版本。

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].