#parser #data #streamed #udp-socket #net #mocopi

mocopi_parser

A parser of streamed data from mocopi

4 releases (2 breaking)

0.3.1 May 17, 2023
0.3.0 May 17, 2023
0.2.0 May 16, 2023
0.1.0 Apr 24, 2023

#40 in #udp-socket

Download history 11/week @ 2024-09-20 1/week @ 2024-09-27

63 downloads per month

MIT license

12KB
257 lines

mocopi-parser

mocopi-parser is a parser library of streamed data from mocopi.

Example

This example using local-ip-address crate.

use std::net::UdpSocket;
use local_ip_address::local_ip;

fn main() {
    let ip = local_ip().unwrap();
    let port = 12351;
    let addr = format!("{}:{}", ip, port);

    let socket = UdpSocket::bind(&addr).unwrap();

    let mut buff = [0u8; 2048];

    loop {
        socket.recv_from(buff).unwrap();

        let packet = mocopi_parser::parse(&buff).unwrap();
        
        println!("{:?}", packet);
    }
}

References

  1. mocopi receiver
  2. 技術仕様

Dependencies

~1.2–2MB
~40K SLoC