fix(fake-tcp) fix an issue where RST generated is not following

the proper RFC requirement.

Send ACK every 128MB in lieu of data packets.
This commit is contained in:
Datong Sun
2022-04-10 01:30:28 -07:00
parent 1c35635091
commit 95dfd8ab54
3 changed files with 37 additions and 17 deletions

View File

@@ -99,6 +99,7 @@ async fn main() {
.expect("bad peer address for Tun interface");
let num_cpus = num_cpus::get();
info!("{} cores available", num_cpus);
let tun = TunBuilder::new()
.name(matches.value_of("tun").unwrap()) // if name is empty, then it is set by kernel.
@@ -157,7 +158,7 @@ async fn main() {
for i in 0..num_cpus {
let sock = sock.clone();
let quit = quit.child_token();
let quit = quit.clone();
let packet_received = packet_received.clone();
tokio::spawn(async move {

View File

@@ -94,6 +94,7 @@ async fn main() {
.expect("bad peer address for Tun interface");
let num_cpus = num_cpus::get();
info!("{} cores available", num_cpus);
let tun = TunBuilder::new()
.name(matches.value_of("tun").unwrap()) // if name is empty, then it is set by kernel.
@@ -134,7 +135,7 @@ async fn main() {
for i in 0..num_cpus {
let sock = sock.clone();
let quit = quit.child_token();
let quit = quit.clone();
let packet_received = packet_received.clone();
let udp_sock = new_udp_reuseport(local_addr);