https://github.com/lianzeng/networklib
multi thread network library using epoll+nonblocking io in C++11
https://github.com/lianzeng/networklib
cpp11 framework library linux-programming multi-threading network-programming
Last synced: 18 days ago
JSON representation
multi thread network library using epoll+nonblocking io in C++11
- Host: GitHub
- URL: https://github.com/lianzeng/networklib
- Owner: lianzeng
- Created: 2017-12-12T15:59:34.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-03-08T11:29:06.000Z (about 7 years ago)
- Last Synced: 2024-04-06T06:41:31.451Z (almost 2 years ago)
- Topics: cpp11, framework, library, linux-programming, multi-threading, network-programming
- Language: C++
- Homepage:
- Size: 126 KB
- Stars: 4
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# multiThread network library on linux platform Using C++11
linux multi thread programming in C++11.
1)IO multiplexing: poll, epoll;
2)use nonblock IO, support fd type: socketfd, timerfd, eventfd, listenfd; provide a unify framework for timer,socket,signal processing.
3)one IO/Event loop per thread + reactor(callback), using std::bind + std::function to implement callback;
4)tcp connections are balanced among threads;
5)the tcp server has 1 acceptor thread + event_loop_thread_pool;
6)each tcp connection has 1 owner eventloop thread, other threads operator the connection by adding a task to the ownerloop's taskqueue.
7)test cases could run independently, with valgrind memory detect;
8)User call TcpConnection::send(msg) to send msg, and provide Callback to process peer msg(refer to multiThread/libnet/test/TestEchoClient.cpp).
9).It's easy to learn the message flow from EchoClient.log and EchoServer.log;
# This project is build on following environment:
Linux x86_64 Ubuntu 15.04; GCC 4.9.2
# Develop Tool used:
Git + Clion_Linux_Version / VScode