代码拉取完成,页面将自动刷新
Linux: ubuntu14 64bit g++4.8.1 上测试通过
MacOSX: LLVM version 6.1.0 上测试通过
MacOSX: 支持CLion IDE
优雅退出可以让程序员更好的定义自己程序的退出行为
能够更好的借助valgrind等工具检查内存泄露。
10行代码能够编写一个完整的服务器
#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, "", 2099);
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,能够找到<openssl/ssl.h>,项目会自动下载handy-ssl 由于openssl的开源协议与此不兼容,所以项目文件单独放在handy-ssl
使用protobuf的消息encode/decode示例在protobuf下
支持udp,udp的客户端采用connect方式使用,类似tcp
make && make install
使用os提供的api如epoll,kqueue编写并发应用程序
使用handy的示例
Use of this source code is governed by a BSD-style license that can be found in the License file.
如果您觉得此项目不错,或者对您有帮助,请赏颗星吧!
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。