lemunozm / message-io

Fast and easy-to-use event-driven network library.
Apache License 2.0
1.11k stars 74 forks source link

Panicked at Result unwrap bug #119

Closed fgadaleta closed 2 years ago

fgadaleta commented 2 years ago

Reproducibility

While running the discovery server (as in the examples), if I disconnect with some peers, I get a panic from

let addr = self.stream.peer_addr().unwrap(); in message-io-0.14.4/src/adapters/framed_tcp.rs:65:56

thread 'tokio-runtime-worker' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 107, kind: NotConnected, message: "Transport endpoint is not connected" }', /home/frag/.cargo/registry/src/github.com-1ecc6299db9ec823/message-io-0.14.4/src/adapters/framed_tcp.rs:65:56
lemunozm commented 2 years ago

Hi, I fixed the issue here https://github.com/lemunozm/message-io/pull/120, but I would like to reproduce your error because I never got it. Could you please give some feedback about:

Thanks!

fgadaleta commented 2 years ago

It doesn't happen all the time. I think that when I get closer to saturating the network it happens more often and definitely when the clients disconnect (or i kill them).

dovahcrow commented 2 years ago

Yep I got the same issue panicked at 'called Result::unwrap() on an Err value: Os { code: 107, kind: NotConnected, message: "Transport endpoint is not connected" }', /home /ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/message-io-0.14.4/src/adapters/framed_tcp.rs:65:56

lemunozm commented 2 years ago

I updated message-io to 0.14.5 which solves the issue.

Thanks for reporting!