CryptoGladi / snwf

Library for simple network work on files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

snwf

Library for simple network work on files

license buld

Motivation 🚀

If you just need to transfer a file over the network to another computer, but you don't want to write hundreds of lines of code to implement a receiver and sender, then this library is right for you.

Features ⭐

  • udt - enable udt protocol support

Example (udt)

use snwf::prelude::*;
use std::path::Path;

#[tokio::main]
async fn main() {
   let mut sender = Sender::new("127.0.0.1".parse().unwrap(), 4324, 6343, None);
   let mut recipient = Recipient::new("::0".parse().unwrap(), 4324, 6343, None);

   let (recv, send) = tokio::join!(
       recipient.udt_recv_file(Path::new("other_file.txt")),
       sender.udt_send_file(Path::new("file_for_send.txt"))
   );
   
   send.unwrap();
   recv.unwrap();
}

About

Library for simple network work on files

License:MIT License


Languages

Language:Rust 100.0%