All Projects → yedf → Handy

yedf / Handy

Licence: bsd-2-clause
🔥简洁易用的C++11网络库 / 支持单机千万并发连接 / a simple C++11 network server framework

Programming Languages

C++
36643 projects - #6 most used programming language
python
139335 projects - #7 most used programming language
shell
77523 projects
CMake
9771 projects
Makefile
30231 projects
c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Handy

Gnet
🚀 gnet is a high-performance, lightweight, non-blocking, event-driven networking framework written in pure Go./ gnet 是一个高性能、轻量级、非阻塞的事件驱动 Go 网络框架。
Stars: ✭ 5,736 (+50.35%)
Mutual labels:  networking, epoll
Hp Socket
High Performance TCP/UDP/HTTP Communication Component
Stars: ✭ 4,420 (+15.86%)
Mutual labels:  networking, epoll
Pynetdicom
A Python implementation of the DICOM networking protocol
Stars: ✭ 289 (-92.42%)
Mutual labels:  networking
Cni
Container Network Interface - networking for Linux containers
Stars: ✭ 3,907 (+2.41%)
Mutual labels:  networking
Poseidon
Poseidon is a python-based application that leverages software defined networks (SDN) to acquire and then feed network traffic to a number of machine learning techniques. The machine learning algorithms classify and predict the type of device.
Stars: ✭ 310 (-91.87%)
Mutual labels:  networking
Netfox
A lightweight, one line setup, iOS / OSX network debugging library! 🦊
Stars: ✭ 3,188 (-16.44%)
Mutual labels:  networking
React Native Network Info
React Native library for getting information about the devices network
Stars: ✭ 313 (-91.8%)
Mutual labels:  networking
Drop watch
Monitor reasons why and where linux drops UDP packets
Stars: ✭ 289 (-92.42%)
Mutual labels:  networking
Nsot
Network Source of Truth is an open source IPAM and network inventory database
Stars: ✭ 337 (-91.17%)
Mutual labels:  networking
Wgctrl Go
Package wgctrl enables control of WireGuard interfaces on multiple platforms.
Stars: ✭ 301 (-92.11%)
Mutual labels:  networking
Wg Meshconf
WireGuard full mesh configuration generator.
Stars: ✭ 319 (-91.64%)
Mutual labels:  networking
Zat
Zeek Analysis Tools (ZAT): Processing and analysis of Zeek network data with Pandas, scikit-learn, Kafka and Spark
Stars: ✭ 303 (-92.06%)
Mutual labels:  networking
Yomo
🦖 Streaming-Serverless Framework for Low-latency Edge Computing applications, running atop QUIC protocol, engaging 5G technology.
Stars: ✭ 279 (-92.69%)
Mutual labels:  networking
Dotnetty
DotNetty project – a port of netty, event-driven asynchronous network application framework
Stars: ✭ 3,422 (-10.3%)
Mutual labels:  networking
Kubernetes Network Policy Recipes
Example recipes for Kubernetes Network Policies that you can just copy paste
Stars: ✭ 3,681 (-3.51%)
Mutual labels:  networking
Libuv
Cross-platform asynchronous I/O
Stars: ✭ 18,615 (+387.94%)
Mutual labels:  networking
Webserver
A C++ High Performance Web Server
Stars: ✭ 4,164 (+9.15%)
Mutual labels:  epoll
Pigeon
Async state management for SwiftUI (and UIKit) 🐦
Stars: ✭ 301 (-92.11%)
Mutual labels:  networking
Web Udp Public
Public demand for Web UDP
Stars: ✭ 312 (-91.82%)
Mutual labels:  networking
Exscript
A Python module making Telnet and SSH easy
Stars: ✭ 337 (-91.17%)
Mutual labels:  networking

handyBuild Status

English

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

多平台支持

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

  • MacOSX: LLVM version 6.1.0 上测试通过

  • MacOSX: 支持CLion IDE

支持优雅退出

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

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

高性能

简洁

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, "", 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,能够找到<openssl/ssl.h>,项目会自动下载handy-ssl 由于openssl的开源协议与此不兼容,所以项目文件单独放在handy-ssl

protobuf支持

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

udp支持

支持udp,udp的客户端采用connect方式使用,类似tcp

安装与使用

make && make install

目录结构

  • handy--------handy库
  • 10m----------进行千万并发连接测试所使用的程序
  • examples----示例
  • raw-examples--原生api使用示例,包括了epoll,epoll ET模式,kqueue示例
  • ssl------------openssl相关的代码与示例
  • protobuf-----handy使用protobuf的示例
  • test-----------handy相关的测试

使用文档

raw-examples

使用os提供的api如epoll,kqueue编写并发应用程序

  • epoll.cc,演示了epoll的通常用法,使用epoll的LT模式
  • epoll-et.cc,演示了epoll的ET模式,与LT模式非常像,区别主要体现在不需要手动开关EPOLLOUT事件

examples

使用handy的示例

  • echo.cc 简单的回显服务
  • timer.cc 使用定时器来管理定时任务
  • idle-close.cc 关闭一个空闲的连接
  • reconnect.cc 设置连接关闭后自动重连
  • safe-close.cc 在其他线程中安全操作连接
  • chat.cc 简单的聊天应用,用户使用telnet登陆后,系统分配一个用户id,用户可以发送消息给某个用户,也可以发送消息给所有用户
  • codec-cli.cc 发送消息给服务器,使用的消息格式为mBdT开始,紧接着4字节的长度,然后是消息内容
  • codec-svr.cc 见上
  • hsha.cc 半同步半异步示例,用户可以把IO交给handy框架进行处理,自己同步处理用户请求
  • http-hello.cc 一个简单的http服务器程序
  • stat.cc 一个简单的状态服务器示例,一个内嵌的http服务器,方便外部的工具查看应用程序的状态
  • write-on-empty.cc 这个例子演示了需要写出大量数据,例如1G文件这种情景中的使用技巧
  • daemon.cc 程序已以daemon方式启动,从conf文件中获取日志相关的配置,并初始化日志参数
  • udp-cli.cc udp的客户端
  • udp-svr.cc udp服务器
  • udp-hsha.cc udp的半同步半异步服务器

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群

  • 群2:775245483
  • 群1: 189076978

如果您觉得此项目不错,或者对您有帮助,请赏颗星吧!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].