(mut socket: tokio::net::TcpStream)
| 3119 | } |
| 3120 | |
| 3121 | async fn drain_and_shutdown_local_socket(mut socket: tokio::net::TcpStream) { |
| 3122 | use tokio::io::{AsyncReadExt, AsyncWriteExt}; |
| 3123 | |
| 3124 | let mut buf = [0u8; 4096]; |
| 3125 | while matches!( |
| 3126 | tokio::time::timeout(Duration::from_millis(25), socket.read(&mut buf)).await, |
| 3127 | Ok(Ok(n)) if n != 0 |
| 3128 | ) {} |
| 3129 | let _ = socket.shutdown().await; |
| 3130 | } |
| 3131 | |
| 3132 | struct RawModeGuard; |
| 3133 |
no outgoing calls
no test coverage detected