Giter Site home page Giter Site logo

2ero / handy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yedf2/handy

0.0 2.0 0.0 267 KB

最好用的C++11网络库 / 支持单机千万并发连接 / a simple C++11 network server framework

License: BSD 2-Clause "Simplified" License

C++ 94.07% Makefile 1.63% Shell 4.13% C 0.11% Protocol Buffer 0.07%

handy's Introduction

handyBuild Status

English ##简洁易用的C++11网络库

###多平台支持

  • Linux: ubuntu14 64bit g++4.8.1 上测试通过

  • MacOSX: LLVM version 6.1.0 上测试通过

###支持优雅退出

优雅退出可以让程序员更好的定义自己程序的退出行为

能够更好的借助valrind等工具检查内存泄露。

###高性能

###简洁

10行代码能够编写一个完整的服务器

###代码示例--echo-server

#include <handy/handy.h>
using namespace handy;

int main(int argc, const char* argv[]) {
    EventBase base;
    Signal::signal(SIGINT, [&]{ base.exit(); });
    TcpServerPtr svr = TcpServer::startServer(&base, "", 99);
    exitif(svr == NULL, "start tcp server failed");
    svr->onConnRead([](const TcpConnPtr& con) {
        con->send(con->getInput());
    });
    base.loop();
}

###支持半同步半异步处理

异步管理网络I/O,同步处理请求,可以简化服务器处理逻辑的编写,示例参见examples/hsha.cc

###openssl支持

异步连接管理,支持openssl连接

###protobuf支持

使用protobuf的消息encode/decode示例在protobuf下

###安装与使用

make && make install

###目录结构

  • handy--------handy库
  • examples----示例
  • ssl------------openssl相关的代码与示例
  • protobuf-----handy使用protobuf的示例
  • test-----------handy相关的测试

###使用文档

license

Use of this source code is governed by a BSD-style license that can be found in the License file.

email

[email protected]

qq群

189076978

handy's People

Watchers

James Cloos avatar  avatar

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.