3 ms·
> I imagine it's &TcpStream because the TcpStream is used by both the reading and writing halves. Yes, and in fact in older versions of tokio reading and writi
by leshow 5y ago
> I imagine it's &TcpStream because the TcpStream is used by both the reading and writing halves.
Yes, and in fact in older versions of tokio reading and writing required &mut, even for things like UdpSocket, which was a bit of a pain when you wanted to write to a socket concurrently as you couldn't just use an Arc.