Rust Tokio 异步多客户端网络框架 高并发 插件化

Overview

Rust-Tcp-Async-Client

Rust实现的异步多客户端网络框架,基于tokiomlua,可自定义通讯协议 插件化采用lua。应用场景im,game server,bot等.golang 实现的网络框架就很多了,个人希望能在Rust做一些微不足道的贡献,该项目的代码也很简陋属于 demo ,线上生产还是需要深加工.欢迎 👏 各位大佬吐槽毕竟我还是Rust萌新项目更多的代码 Copy 自 tox-rs hhhhhh

🎈 框架 🎈

主线程维护多个client,将消息分发至lua。

🎈 性能 🎈

性能和并发这我不想说,我等萌新再弱鸡,Rust的优势会弥补我们的不足。弘扬Rust势在必行emm......Golang弟弟表示不服....

🎈 协议 🎈

自定义协议部分并没有抽离出来,因为本人正处于并将长期处于萌新阶段。。hhhh 请阅读源码codec.rs来实现自己的协议即可 编码器采用的 tokioCodec

🎈 插件 🎈

在Plugins目录下已给出demo 默认绑定了2个函数 OnChatMsgOnChatEvent 收到消息的时候会遍历插件并调用OnChatMsg和收到相关事件的时候会遍历插件并调用OnChatEvent demo中绑定了3个luaApi 详情请见test.lua

🎈 指南食用 🎈

1⃣ ️ 克隆项目

git clone https://github.com/OPQBOT/rust-tcp-async-client.git

2⃣

cd rust-tcp-async-client

3⃣ ️ VSCode打开

code .

4⃣ ️ 启动server

cd examples
cargo run --package examples --example server-test

5⃣ 启动client

cd examples
cargo run --package examples --example client-test

6⃣ Coding YourSelf

🎈 交流 🎈

🦀️ 🦀️ Star

Drawing Drawing

🎈 License 🎈

Licensed under GPLv3+ .

You might also like...
The gRPC library for Rust built on C Core library and futures

gRPC-rs gRPC-rs is a Rust wrapper of gRPC Core. gRPC is a high performance, open source universal RPC framework that puts mobile and HTTP/2 first. Sta

A library to work with CIDRs in rust

ipnetwork This is a library to work with IPv4 and IPv6 CIDRs in Rust Run Clippy by doing rustup component add clippy cargo clippy Installation This c

Network simulation in Rust

netsim - A Rust library for network simulation and testing (currently linux-only). netsim is a crate for simulating networks for the sake of testing n

Cross-platform, low level networking using the Rust programming language.

libpnet Linux ∪ OS X Build Status: Windows Build Status: Discussion and support: #libpnet on freenode / #rust-networking on irc.mozilla.org / #rust on

A runtime for writing reliable asynchronous applications with Rust. Provides I/O, networking, scheduling, timers, ...

Tokio A runtime for writing reliable, asynchronous, and slim applications with the Rust programming language. It is: Fast: Tokio's zero-cost abstracti

Easy protocol definitions in Rust

protocol Documentation Easy protocol definitions in Rust. This crate adds a custom derive that can be added to types, allowing structured data to be s

Actor framework for Rust.

Actix Actor framework for Rust Documentation User Guide API Documentation API Documentation (master branch) Features Async and sync actors Actor commu

Nanomsg library for Rust

Nanomsg Documentation Nanomsg is a modern messaging library that is the successor to ZeroMQ, written in C by Martin Sustrik and colleagues. The nanoms

NNTP client for Rust

rust-nntp NNTP Client for Rust Usage extern crate nntp; use nntp::{Article, NNTPStream}; fn main() { let mut nntp_stream = match NNTPStream::connec

Owner
OPQBOT
OPQBOT
A super minimal wrapper around unix sockets for IPC on top of tokio.

tokio-unix-ipc This crate implements a minimal abstraction over UNIX domain sockets for the purpose of IPC on top of tokio.

Armin Ronacher 26 Nov 18, 2022
Super simple tokio chat server for educational purposes.

achat A collection of simple modules which showcase simple use of tasks, channels, and other tokio primitives to implement simple networking applicati

Rafael Bachmann 2 Dec 29, 2022
Stream API for tokio-udp.

UDPflow Stream API for tokio-udp. TCP-like UDP stream use tokio::net::UdpSocket; use tokio::io::{AsyncReadExt, AsyncWriteExt}; use udpflow::{UdpListen

zephyr 5 Dec 2, 2022
Asynchronous Linux SocketCAN - Broadcast Manager support (BCM) with tokio

tokio-socketcan-bcm The Broadcast Manager protocol provides a command based configuration interface to filter and send (e.g. cyclic) CAN messages in k

Marcel 4 Nov 8, 2022
Grow Rust is a Growtopia Private Server made in Rust

Grow Rust is a Growtopia Private Server made in Rust

null 14 Dec 7, 2022
Multiplex server for rust-analyzer, allows multiple LSP clients (editor windows) to share a single rust-analyzer instance per cargo workspace

ra-multiplex   Multiplex server for rust-analyzer, allows multiple LSP clients (editor windows) to share a single rust-analyzer instance per cargo wor

max 95 Dec 29, 2022
DNS Server written in Rust for fun, see https://dev.to/xfbs/writing-a-dns-server-in-rust-1gpn

DNS Fun Ever wondered how you can write a DNS server in Rust? No? Well, too bad, I'm telling you anyways. But don't worry, this is going to be a fun o

Patrick Elsen 26 Jan 13, 2023
Rust crate for configurable parallel web crawling, designed to crawl for content

url-crawler A configurable parallel web crawler, designed to crawl a website for content. Changelog Docs.rs Example extern crate url_crawler; use std:

Pop!_OS 56 Aug 22, 2021
Rust crate for scraping URLs from HTML pages

url-scraper Rust crate for scraping URLs from HTML pages. Example extern crate url_scraper; use url_scraper::UrlScraper; fn main() { let director

Pop!_OS 35 Aug 18, 2022
FTP client for Rust

rust-ftp FTP client for Rust Documentation rust-ftp Installation Usage License Contribution Development environment Installation FTPS support is achie

Matt McCoy 155 Nov 12, 2022