Skip to content

Commit

Permalink
more debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
sunfishcode committed Aug 15, 2023
1 parent 844a50b commit 01a3660
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions crates/wasi/src/preview2/host/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ impl<T: WasiView> tcp::Host for T {
let result = binder.bind_existing_tcp_listener(clone.tcp_socket());
dbg!(&result);
*clone.0.result.lock().unwrap() = Some(result);
eprintln!("@@ bind task notifying");
clone.0.sender.send(()).unwrap();
eprintln!("@@ bind task done");
});
Expand Down Expand Up @@ -225,6 +226,7 @@ impl<T: WasiView> tcp::Host for T {
let join = spawn_blocking(move || {
let result = clone.tcp_socket().listen(None);
*clone.0.result.lock().unwrap() = Some(result);
eprintln!("@@ listen task notifying");
clone.0.sender.send(()).unwrap();
});

Expand Down Expand Up @@ -261,6 +263,7 @@ impl<T: WasiView> tcp::Host for T {
*clone.0.result.lock().unwrap() = Some(Err(err));
}
}
eprintln!("@@ finish listen task notifying");
clone.0.sender.send(()).unwrap();
});

Expand Down Expand Up @@ -320,6 +323,7 @@ impl<T: WasiView> tcp::Host for T {
*clone.0.result.lock().unwrap() = Some(Err(err));
}
}
eprintln!("@@ accept notifying");
clone.0.sender.send(()).unwrap();
});

Expand Down Expand Up @@ -556,7 +560,9 @@ impl<T: WasiView> tcp::Host for T {
let clone = clone.clone();
Box::pin(async move {
let mut receiver = clone.0.receiver.lock().await;
eprintln!("$$ waiting");
receiver.changed().await.unwrap();
eprintln!("$$ receiveed a notification");
assert!(!receiver.has_changed().unwrap());
Ok(())
})
Expand Down

0 comments on commit 01a3660

Please sign in to comment.