Skip to content

BerryLin-PX/tcp_kit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tcp_kit

tcp_kit is a lightweight, cross-platform network protocol development kit based on the C++11 standard. It adopts the Reactor event-driven model and supports multithreading and asynchronous I/O operations. This kit is designed to provide developers with:

  • ๐Ÿš€ High-performance network processing: Event loop driven by libevent
  • ๐Ÿ“ฆ Out-of-the-box protocol stack: Built-in common encoding/decoding and encryption/decryption protocols
  • ๐Ÿ–ฅ๏ธ Cross-platform support: Compatible with Linux and macOS

โšก๏ธ Quick Start

๐ŸŒ Environment

  • Compiler๏ผšGCC 4.8.5+
  • Dependencies: libevent 2.1+, Protobuf 3.0+
  • Build System: CMake 2.8+

Chinese Documentations

๐Ÿ›  Installation

Clone the Repository

git clone https://github.com/BerryLin-PX/tcp_kit.git
cd tcp_kit

Install Dependencies

  • CentOS
    sudo yum install -y libevent-devel protobuf-devel
  • macOS
    brew install libevent protobuf

Build tcp_kit

mkdir build && cd build
cmake ..
sudo make install

๐Ÿ“ข Echo Server

#include <tcp_kit/network/server.h>
#include <tcp_kit/network/generic.h>

int main() {
    tcp_kit::server<generic, 3000> svr;
    svr.api("echo", [](std::string msg) {
        return msg;
    });
    svr.start();
}

Looking forward to the first official release! ๐Ÿบ

About

A lightweight C++ network development framework implemented based on libevent.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published