webrtc-rs/examples

[data-channels-flow-control] Connection is abruptly broken

tmthecoder opened this issue · 1 comments

I ran cargo run --example data-channels-flow-control on my laptop after cloning the main repository and changing into the examples directory.

Upon running it, I get the following output:

Press ctrl-c to stop or wait for 5s
Peer Connection State has changed: connected (answerer)
Peer Connection State has changed: connected (offerer)
OnOpen-data-1 : Start sending a series of 1024-byte packets as fast as it can
OnOpen: Start receiving data
Throughput: 6.853 Mbps
Throughput: 7.021 Mbps
Throughput: 7.113 Mbps
Throughput: 7.125 Mbps
exit on_open
Peer Connection State has changed: closed (offerer)
Peer Connection State has changed: closed (answerer)

I added a simple print statement to see why the connection closes and the send loop is exited, and it outputs the following: DataChannel is not opened

it is expected, since it only run 5s.

println!("Press ctrl-c to stop or wait for 5s");
let timeout = tokio::time::sleep(Duration::from_secs(5));
tokio::pin!(timeout);

The timeout is added on purpose in order to debug reference cycling leaking issue.