GithubHelp home page GithubHelp logo

A new beginning of network programming

What is Netplus

Netplus is a network programming library written in c++11. It's highly extensible, and with default configuration it can reach high performance. It's easy to learn. Basically, you can just implement your own business in a channel handler, then the library would do all the dirty work (platform specific considerations, io event delivery&process, basic memory optimization, etc ) for you. You can also write http/https,websocket,based application even you only have little corresponding knowledge background, Cuz it has relevant modules to simplify programming tasks of such kinds. Netplus borrows lots of concepts from Netty, and tries to implement these concepts by c++, such as channel, channel handler, channel pipeline, executor, scheduler, promise. Any one who is familiar with Netty should be able to start with ease.

What can we use Netplus to do

1) Implement a message gateway
2) Use as the network component of a message queue, gameserver or any other network based application.
   please note that netplus is not a gameserver framework, But you can implement one with netplus
3) Implement protocol driver of Middleware, such as kinds of database, message queue server, etc
4) Implement http/https, websocket based application
5) Implement RPC server

Target Arch & Platform

1) Windows on x86/x64
2) Linux on x86/x64/arm
3) IOS/MAC on x86/arm
4) Android on x86/arm

First Impression

//listen on 0.0.0.0:80 port for a http service, 
netp::listen_on("tcp://0.0.0.0:80", [](NRP<netp::channel> const& ch) {
    ch->pipeline()->add_last(netp::make_ref<netp::handler::http>());
    ...
}

//fast request for a http request
NRP<netp::http::request_promise> rp = netp::http::get("https://x.com/");

//listen on 10088 for a rpc service
netp::rpc::listen("tcp://0.0.0.0:10088",[](NRP<netp::rpc> const& r){
   r->bindcall( api_id, []( NRP<netp::rpc> const& r, NRP<netp::packet> cosnt& in, NRP<netp::rpc_call_promise> const& rcp ) {
       NETP_INFO("[rpc]a request in, request pkt len: %u", in->len() );
       NRP<netp::packet> reply = netp::make_ref<netp::packet>();
       reply->write("this is a reply from the call to api_id");
       
       //call return with netp::OK, and a message in reply pkt
       rcp->set(std::make_tuple(netp::OK, reply));
   });
},...);

Learn more from the following urls:

Build and usage: https://github.com/netplus/netplus/wiki#building--usage

Quick Start: https://github.com/netplus/netplus/wiki#%E5%BF%AB%E9%80%9F%E5%BC%80%E5%A7%8B

Benchmark: https://github.com/netplus/netplus/wiki#benchmark

Examples: https://github.com/netplus/netplus/wiki#examples

Basic concept: https://github.com/netplus/netplus/wiki#concept

Modules: https://github.com/netplus/netplus/wiki#modules

Zhihu: https://www.zhihu.com/column/c_1339539434091040768

Others

QQ group: 576499184 (加群请注明来源,thx)

BingBing's Projects

bpftrace icon bpftrace

High-level tracing language for Linux eBPF

cli11 icon cli11

CLI11 is a command line parser for C++11 and beyond that provides a rich feature set with a simple and intuitive interface.

dnsmasq icon dnsmasq

Mirror of the upstream dnsmasq repository

gmssl icon gmssl

支持国密SM2/SM3/SM4/SM9/SSL的密码工具箱

netplus icon netplus

An easy-to-learn, high performance network io library written in modern cpp (c++11), It borrows concepts from Netty, and with well defined internal modules, It enables you to write rpc, http/https,websocket application with just few lines。

pgpool2 icon pgpool2

This is the official mirror of git://git.postgresql.org/git/pgpool2.git. Note that this is just a *mirror* - we don't work with issues/pull requests on github. Please visit our web site to file bug reports or submit patches.

postgres icon postgres

Mirror of the official PostgreSQL GIT repository. Note that this is just a *mirror* - we don't work with pull requests on github. To contribute, please see https://wiki.postgresql.org/wiki/Submitting_a_Patch

rclone icon rclone

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Yandex Files

serverstatus icon serverstatus

云探针、多服务器探针、云监控、多服务器云监控,演示: https://tz.cloudcpp.com/

userver icon userver

The C++ Asynchronous Framework (beta)

w64devkit icon w64devkit

Portable C and C++ Development Kit for x64 (and x86) Windows

windows-driver-samples icon windows-driver-samples

This repo contains driver samples prepared for use with Microsoft Visual Studio and the Windows Driver Kit (WDK). It contains both Universal Windows Driver and desktop-only driver samples.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.