All Projects → IfanTsai → Mgx

IfanTsai / Mgx

Licence: other
🌈 A high performance network framework written in c++ (support tcp and http)

Programming Languages

C++
36643 projects - #6 most used programming language
javascript
184084 projects - #8 most used programming language
Makefile
30231 projects
HTML
75241 projects
c
50402 projects - #5 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to Mgx

Webserver
A C++ High Performance Web Server
Stars: ✭ 4,164 (+27660%)
Mutual labels:  http-server, thread-pool, epoll
Mongols
C++ high performance networking with TCP/UDP/RESP/HTTP/WebSocket protocols
Stars: ✭ 250 (+1566.67%)
Mutual labels:  tcp-server, http-server, epoll
Webcpp
用C++开发web服务器框架
Stars: ✭ 23 (+53.33%)
Mutual labels:  http-server, thread-pool, epoll
cs
开箱即用的基于命令的消息处理框架,让 websocket 和 tcp 开发就像 http 那样简单
Stars: ✭ 19 (+26.67%)
Mutual labels:  tcp, tcp-server, http-server
Swoft
🚀 PHP Microservice Full Coroutine Framework
Stars: ✭ 5,420 (+36033.33%)
Mutual labels:  tcp-server, http-server, coroutine
Qtnetworkng
QtNetwork Next Generation. A coroutine based network framework for Qt/C++, with more simpler API than boost::asio.
Stars: ✭ 125 (+733.33%)
Mutual labels:  tcp, http-server, coroutine
YACLib
Yet Another Concurrency Library
Stars: ✭ 193 (+1186.67%)
Mutual labels:  thread-pool, coroutine
fancy
High performance web server
Stars: ✭ 20 (+33.33%)
Mutual labels:  http-server, epoll
Burger
🍔 c++11 Server based on coroutine and reactor
Stars: ✭ 58 (+286.67%)
Mutual labels:  tcp-server, coroutine
hev-task-system
A simple, lightweight multi-task system (coroutines) for Unix (Linux/BSD/macOS)
Stars: ✭ 41 (+173.33%)
Mutual labels:  epoll, coroutine
Zserver4d
ZServer4D 是一套从商业项目剥离而出的云服务器中间件,可以承载百万级的分布式负载服务,并且支持IoT及内网穿透
Stars: ✭ 199 (+1226.67%)
Mutual labels:  tcp, epoll
QTcpSocket
A simple Qt client-server TCP architecture to transfer data between peers
Stars: ✭ 62 (+313.33%)
Mutual labels:  tcp, tcp-server
SuperSimpleTcp
Simple wrapper for TCP client and server in C# with SSL support
Stars: ✭ 263 (+1653.33%)
Mutual labels:  tcp, tcp-server
go-eventserver
A socket server which reads events from an event source and forwards them to the user clients when appropriate
Stars: ✭ 18 (+20%)
Mutual labels:  tcp, tcp-server
WebServer
High-performance multi-threaded tcp network server in c++11
Stars: ✭ 58 (+286.67%)
Mutual labels:  http-server, epoll
tcp server client
A thin and simple C++ TCP client server
Stars: ✭ 124 (+726.67%)
Mutual labels:  tcp, tcp-server
Oksocket
An blocking socket client for Android applications.
Stars: ✭ 2,359 (+15626.67%)
Mutual labels:  tcp, tcp-server
AsyncTcpClient
An asynchronous variant of TcpClient and TcpListener for .NET Standard.
Stars: ✭ 125 (+733.33%)
Mutual labels:  tcp, tcp-server
network
exomia/network is a wrapper library around System.Socket for easy and fast TCP/UDP client & server communication.
Stars: ✭ 18 (+20%)
Mutual labels:  tcp, tcp-server
WebServer
C++高性能网络服务器
Stars: ✭ 53 (+253.33%)
Mutual labels:  tcp, epoll

中文

A high performance network framework using epoll, connections pool and threads pool (support tcp and http)

The framework doesn't depend on any third party components

The framework mainly implements the following features

  • a master process and multiple subprocesses(worker processes)
    • the master process is responsible for signal processing
      • such as reviving the subprocess, log rotate (kill -USER1 master_pid) ...
    • the worker processes handle specific network requests (use epoll LT mode)
  • configuration file and log system
  • threads pool processing client messages
  • a thread and message queues handle the sending of messages
  • delay reclaiming connections in connection pool
  • heartbeat packet mechanism and detection timer queue to reclain connections
  • using specific message format to solve tcp packet sticking problem

By default, the source code is configured to http mode. If you need to configure tcp mode, please modify the variable of config.mk under the root path.

export USE_HTTP = false

In addition, this project also implements a coroutine library, and implements a set of cosocket's APIs based on this coroutine library, but note that it's not integrated into above framework. You can see their use in the test directory.

Mainly realize code:

Note: The coroutine library currently only implements x86-64 and ARM64 platforms

Quick Start

start in host machine

make -j4
./mgx
curl 127.0.0.1:8081  # or view web page in browser

start in docker

docker build -t mgx:latest .
docker run -itd -p 8081:8081 mgx:latest
curl 127.0.0.1:8081  # or view web page in browser

You can access http://127.0.0.1:8081 to view the web page in browser

image-20220211203019092

The general structure of Mgx

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].