如何将 ReadHalf 和 WriteHalf 重新加入 TcpStream
How to rejoin `ReadHalf` and `WriteHalf` into a `TcpStream`
有没有办法在 split 之后将 Tokio ReadHalf
和 WriteHalf
重新加入 TcpStream
?
let mut stream = TcpStream::connect("127.0.0.1:8080").await?;
let (reader, writer) = stream.split();
// re-join pseudo-code
let stream: TcpStream = (reader, writer).join();
To restore this read/write object from its split::ReadHalf and split::WriteHalf use unsplit.
有没有办法在 split 之后将 Tokio ReadHalf
和 WriteHalf
重新加入 TcpStream
?
let mut stream = TcpStream::connect("127.0.0.1:8080").await?;
let (reader, writer) = stream.split();
// re-join pseudo-code
let stream: TcpStream = (reader, writer).join();
To restore this read/write object from its split::ReadHalf and split::WriteHalf use unsplit.