fix(remoteingress-core): disable Nagle's algorithm on edge, hub, and upstream TCP sockets to reduce control-frame latency

This commit is contained in:
2026-03-16 09:36:03 +00:00
parent 32f9845495
commit 679b247c8a
4 changed files with 16 additions and 2 deletions

View File

@@ -270,7 +270,11 @@ async fn connect_to_hub_and_run(
let addr = format!("{}:{}", config.hub_host, config.hub_port);
let tcp = match TcpStream::connect(&addr).await {
Ok(s) => s,
Ok(s) => {
// Disable Nagle's algorithm for low-latency control frames (PING/PONG, WINDOW_UPDATE)
let _ = s.set_nodelay(true);
s
}
Err(e) => {
log::error!("Failed to connect to hub at {}: {}", addr, e);
return EdgeLoopResult::Reconnect;