mezzenger-udp

Crates.iomezzenger-udp
lib.rsmezzenger-udp
version0.1.5
sourcesrc
created_at2022-11-11 14:41:42.646518
updated_at2023-09-13 13:46:45.899965
descriptionUDP mezzenger transport.
homepagehttps://github.com/zduny/mezzenger/tree/master/mezzenger-udp
repositoryhttps://github.com/zduny/mezzenger
max_upload_size
id712883
size61,520
Daniel Zduniak (zduny)

documentation

https://docs.rs/mezzenger-udp/

README

mezzenger-udp

UDP transport for mezzenger.

https://crates.io/crates/mezzenger-udp

ko-fi

usage

Add dependencies to Cargo.toml:

[dependencies]
# ...
serde = { version = "1", features = ["derive"] }
kodec = { version = "0.1.0", features = ["binary"] } # or json or different one from another crate...
mezzenger = "0.1.3"
mezzenger-udp = "0.1.2"

Now, in code:

let udp_socket = UdpSocket::bind("127.0.0.1:8080").await?;
udp_socket.connect(remote_address).await?;

use kodec::binary::Codec;
let mut transport: Transport<_, Codec, i32, String> =
    Transport::new(udp_socket, Codec::default());

use mezzenger::Receive;
let integer = transport.receive().await?;

transport.send("Hello World!".to_string()).await?;

see also

mezzenger

Commit count: 191

cargo fmt