All Projects → IronsDu → Joynet

IronsDu / Joynet

Licence: mit
high performance network (tcp socket) library for lua, based on https://github.com/IronsDu/brynet and lua coroutine.

Programming Languages

lua
6591 projects

Projects that are alternatives of or similar to Joynet

Tls Channel
A Java library that implements a ByteChannel interface over SSLEngine, enabling easy-to-use (socket-like) TLS for Java applications.
Stars: ✭ 113 (+11.88%)
Mutual labels:  non-blocking, networking
Gnet
🚀 gnet is a high-performance, lightweight, non-blocking, event-driven networking framework written in pure Go./ gnet 是一个高性能、轻量级、非阻塞的事件驱动 Go 网络框架。
Stars: ✭ 5,736 (+5579.21%)
Mutual labels:  non-blocking, networking
Dasynq
Thread-safe cross-platform event loop library in C++
Stars: ✭ 127 (+25.74%)
Mutual labels:  non-blocking, cross-platform
Litenetlib
Lite reliable UDP library for Mono and .NET
Stars: ✭ 2,179 (+2057.43%)
Mutual labels:  networking, cross-platform
Poco
The POCO C++ Libraries are powerful cross-platform C++ libraries for building network- and internet-based applications that run on desktop, server, mobile, IoT, and embedded systems.
Stars: ✭ 5,762 (+5604.95%)
Mutual labels:  networking, cross-platform
Ws Machine
WS-Machine is a websocket finite state machine for client websocket connections (Go)
Stars: ✭ 110 (+8.91%)
Mutual labels:  non-blocking, networking
Hp Socket
High Performance TCP/UDP/HTTP Communication Component
Stars: ✭ 4,420 (+4276.24%)
Mutual labels:  networking, cross-platform
Netlink
Socket and Networking Library using msgpack.org[C++11]
Stars: ✭ 197 (+95.05%)
Mutual labels:  networking, cross-platform
Airshare
Cross-platform content sharing in a local network
Stars: ✭ 497 (+392.08%)
Mutual labels:  networking, cross-platform
Curlcpp
An object oriented C++ wrapper for CURL (libcurl)
Stars: ✭ 462 (+357.43%)
Mutual labels:  networking, cross-platform
Easyhttpcpp
A cross-platform HTTP client library with a focus on usability and speed
Stars: ✭ 110 (+8.91%)
Mutual labels:  networking, cross-platform
Swift Nio
Event-driven network application framework for high performance protocol servers & clients, non-blocking.
Stars: ✭ 6,777 (+6609.9%)
Mutual labels:  non-blocking, networking
Cute headers
Collection of cross-platform one-file C/C++ libraries with no dependencies, primarily used for games
Stars: ✭ 3,274 (+3141.58%)
Mutual labels:  networking, cross-platform
Mio
Metal IO library for Rust
Stars: ✭ 4,613 (+4467.33%)
Mutual labels:  non-blocking, networking
Brynet
A Header-Only cross-platform C++ TCP network library . Can use vcpkg(https://github.com/Microsoft/vcpkg/tree/master/ports/brynet) install
Stars: ✭ 674 (+567.33%)
Mutual labels:  networking, cross-platform
Libpnet
Cross-platform, low level networking using the Rust programming language.
Stars: ✭ 1,322 (+1208.91%)
Mutual labels:  networking, cross-platform
Entitas Sync Framework
Networking framework for Entitas ECS. Targeted at turnbased games or other slow-paced genres.
Stars: ✭ 98 (-2.97%)
Mutual labels:  networking
Cherrypy
CherryPy is a pythonic, object-oriented HTTP framework. https://docs.cherrypy.org/
Stars: ✭ 1,363 (+1249.5%)
Mutual labels:  cross-platform
Packetsender
Network utility for sending / receiving TCP, UDP, SSL
Stars: ✭ 1,349 (+1235.64%)
Mutual labels:  cross-platform
Netfil
A kernel network manager with monitoring and limiting capabilities for macOS. #nsacyber
Stars: ✭ 97 (-3.96%)
Mutual labels:  networking

Joynet

Windows : Build status Linux : Build Status

介绍

high performance network library for lua, based on https://github.com/IronsDu/accumulation-dev and lua coroutine. Joynet 的网络底层使用多线程,但Lua (层面)是运行在单线程上。借助协程提供同步形式的API。

src 目录是此项目源代码

libs 目录为基于此Lua协程网络库开发的一些库(譬如RedisMysqlWebSocketPostgresHTTP Client)

构建

使用 git clone迁出项目并进入项目根目录,并依次使用 git submodule initgit submodule update 下载依赖项.

然后使用cmakevcpkg安装brynet进行构建Joynet动态库

使用

examples 目录包含测试代码。 譬如我们要在Windows下运行PingPong测试:

先在项目根目录执行 lua examples\PingpongServer.lua,然后执行 lua examples\PingpongClient.lua 即可

使用此库也很简单,在你的Lua代码里使用require("Joynet")加载网络库,然后使用CoreDD对象的相关接口即可(具体参考examples目录的各示例代码)

当然,你必须先安装有Lua环境

关于协程

协程是轻量级线程,所以多线程有的问题它也有,只是影响程度不同。 在协程中使用同步API会阻塞当前协程,所以当你的应用程序只有一个协程从外部收取网络消息时,且在消息处理中使用同步API 操作Redis或者Http的话,效率会很低。 这时有两个方案可解决:1 、再提供回调形式的异步API, 但这样会使开发概念混乱 ; 2、 在前面说到的情景的消息处理中再开新协程,并在其中操作HTTP/Redis。 (当然,协程的创建和切换必然有一定开销 ^-^ )

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].