MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / drain_and_shutdown_local_socket

Function drain_and_shutdown_local_socket

crates/openshell-cli/src/run.rs:3121–3130  ·  view source on GitHub ↗
(mut socket: tokio::net::TcpStream)

Source from the content-addressed store, hash-verified

3119}
3120
3121async 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
3132struct RawModeGuard;
3133

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected