1 Star 0 Fork 92

龙在九天 / handy

forked from yedf / handy 
Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
contribute
Sync branch
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README
BSD-2-Clause

handyBuild Status

中文版

A C++11 non-blocking network library

multi platform support

  • Linux: ubuntu14 64bit g++4.8.1 tested

  • MacOSX: LLVM version 6.1.0 tested

elegant program exit

programmer can write operations for exit

can use valgrind to check memory leak

high performance

  • use epoll on Linux

  • use kqueue on MacOSX

performance report

elegant

only 10 lines can finish a complete server

sample --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();
}

half sync half async pattern

processing I/O asynchronously and Request synchronously can greatly simplify the coding of business processing

example can be found examples/hsha.cc

openssl supported

asynchronously handle the openssl connection. if you have installed openssl, then make will automatically download handy-ssl. ssl support files are in handy-ssl because of license.

###protobuf supported

examples can be found in directory protobuf

###Installation

make && make install

###contents

  • handy--------handy library
  • examples----
  • ssl------------openssl support and examples
  • protobuf-----protobuf support and examples
  • test-----------handy test case

###hand book

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

Copyright (c) 2014, yedf All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

About

简洁易用的C++11网络库 / 支持单机千万并发连接 / a C++11 network server framework expand collapse
C++
BSD-2-Clause
Cancel

Releases

No release

Contributors

All

Activities

Load More
can not load any more
C++
1
https://gitee.com/null_570_8310/handy.git
git@gitee.com:null_570_8310/handy.git
null_570_8310
handy
handy
master

Search