Skip to content
forked from yedf2/handy

简洁易用的C++11网络库 / 支持单机千万并发连接 / a C++11 network server framework

License

Notifications You must be signed in to change notification settings

zhangjun03402/handy

 
 

Repository files navigation

handyBuild Status

English ##简洁易用的C++11网络库--参考了陈硕的muduo

###多平台支持

  • 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

dongfuye@163.com

qq群

189076978

About

简洁易用的C++11网络库 / 支持单机千万并发连接 / a C++11 network server framework

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 94.1%
  • Shell 4.1%
  • Makefile 1.6%
  • Other 0.2%