EXPERIMENTAL set higher bitrate

This commit is contained in:
Daniella / Tove 2022-08-13 03:49:40 +02:00
parent b88ee3e6c6
commit 28aa4a7716
2 changed files with 5 additions and 9 deletions

2
Cargo.lock generated
View file

@ -4,4 +4,4 @@ version = 3
[[package]] [[package]]
name = "qft" name = "qft"
version = "0.1.3" version = "0.1.4"

View file

@ -233,7 +233,7 @@ fn helper(args: &Vec<String>) {
fn sender(args: &Vec<String>) { fn sender(args: &Vec<String>) {
let connection = holepunch(args); let connection = holepunch(args);
let mut buf = [0 as u8; 256]; let mut buf = [0 as u8; 1024];
let mut file = File::open(args.get(4).unwrap_or_else(|| { let mut file = File::open(args.get(4).unwrap_or_else(|| {
print_args(args); print_args(args);
panic!("unreachable") panic!("unreachable")
@ -253,15 +253,13 @@ fn sender(args: &Vec<String>) {
sc.write_safe(&buf[..read]).expect("send error"); sc.write_safe(&buf[..read]).expect("send error");
bytes_sent += read as u64; bytes_sent += read as u64;
if bytes_sent % 4096 == 0 { print!("\rSent {} bytes", bytes_sent);
print!("\rSent {} bytes", bytes_sent);
}
} }
} }
fn receiver(args: &Vec<String>) { fn receiver(args: &Vec<String>) {
let connection = holepunch(args); let connection = holepunch(args);
let mut buf: &[u8] = &[0 as u8; 256]; let mut buf: &[u8] = &[0 as u8; 1024];
let mut file = File::create(args.get(4).unwrap_or_else(|| { let mut file = File::create(args.get(4).unwrap_or_else(|| {
print_args(args); print_args(args);
panic!("unreachable") panic!("unreachable")
@ -281,9 +279,7 @@ fn receiver(args: &Vec<String>) {
file.write(buf).expect("write error"); file.write(buf).expect("write error");
bytes_received += len as u64; bytes_received += len as u64;
if bytes_received % (256 * 20) == 0 { print!("\rReceived {} bytes", bytes_received);
print!("\rReceived {} bytes", bytes_received);
}
} }
} }