Giter VIP home page Giter VIP logo

lmess / yasio Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yasio/yasio

0.0 1.0 0.0 33.98 MB

A multi-platform support c++11 library with focus on asio (asynchronous socket I/O) for any client application, support windows & linux & apple & android & win10-universal.

Home Page: https://yasio.org/

License: Other

C++ 99.11% C 0.06% Batchfile 0.03% Makefile 0.05% CMake 0.59% Shell 0.10% Java 0.06%

yasio's Introduction

yasio logo

YASIO - Yet Another asynchronous Socket I/O.

Build Status Windows Build Status Release 996.icu LICENSE GitHub stars GitHub forks Language grade: C/C++ Total alerts
Last Commit

Supported Platforms Powered

English

yasio 是一个轻量级跨平台的异步socket库,专注于客户端和基于各种游戏引擎的游戏客户端网络服务, 支持windows & linux & apple & android & win10-universal。

应用案例

  • 红警OL手游项目: 用于客户端网络传输,并且随着该项目于2018年10月17日由腾讯游戏发行正式上线后稳定运行于上千万移动设备上。
  • x-studio软件项目: 用于实现局域网UDP+TCP发现更新机制。

集成Demos

  • xlua: 将yasio集成到xlua, 使基于xlua的unity3d可以直接使用yasio的lua绑定接口。
  • Unreal Engine 4: 将yasio集成到Unreal Engine 4, 未来会完善Lua, 可能基于Tencent的UnLua.

文档

使用g++快速运行tcptest测试程序

g++ tests/tcp/main.cpp --std=c++11 -DYASIO_HEADER_ONLY -lpthread -I./ -o tcptest && ./tcptest

使用CMake编译yasio的测试程序和示例程序

git clone https://github.com/yasio/yasio
cd yasio
git submodule update --init --recursive
cd build
cmake ..

# 使用CMake命令行编译
# 或者直接用VS打开 yasio.sln 解决方案
cmake --build . --config Debug

特性:

  • 支持IPv4/IPv6或者苹果IPv6_only网络。
  • 支持处理多个连接的所有网络事件。
  • 支持微秒级定时器。
  • 支持TCP粘包处理,业务完全不必关心。
  • 支持Lua绑定。
  • 支持Cocos2d-x jsb绑定。
  • 支持CocosCreator jsb2.0绑定。
  • 支持Unity3D
  • 支持虚幻4
  • 支持组播。
  • 支持KCP。
  • 支持SSL客户端,基于OpenSSL。
  • 支持非阻塞域名解析,基于c-ares。

发送延迟

yasio比同样使用消息队列的Cocos2d-x WebSocket实现处理发送消息快30倍以上:

网络实现 实际执行发送操作延迟
yasio 0.06 ~ 0.1(ms)
Cocos2d-X WebSocket > 3~5(ms)

参考: Cocos2d-X WebSocket.cpp

框架图

image

QQ交流群

点击加入:829884294

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.