|
|
|
|
|
by pjmlp
1831 days ago
|
|
> foo.do_sth_with_socket(); // oops, runtime failure, socket closed Happens just as well in Rust, why do you think I gave you a Playground link. If you want, I can shut up the cleverness with a cargo build example instead of a dummy playground example. |
|
Last two lines of the output:
Btw: you probably fooled yourself by accidentally creating 2 sockets, and indeed the first one gets dropped immediately when you lose (overwrite) the reference to it. Use Option to avoid that.