node: Don't fail connection if TCP_NODELAY errors

This commit is contained in:
cloudhead 2024-05-21 12:34:38 +02:00
parent 064ece32ac
commit 9f36320d83
No known key found for this signature in database
1 changed files with 5 additions and 1 deletions

View File

@ -1108,7 +1108,11 @@ pub fn dial<G: Signer + Ecdh<Pk = NodeId>>(
connection.set_read_timeout(Some(DEFAULT_CONNECTION_TIMEOUT))?;
connection.set_write_timeout(Some(DEFAULT_CONNECTION_TIMEOUT))?;
connection.set_nodelay(true)?;
// There are issues with setting TCP_NODELAY on WSL. Not a big deal.
if let Err(e) = connection.set_nodelay(true) {
log::warn!(target: "wire", "Unable to set TCP_NODELAY on fd {}: {e}", connection.as_raw_fd());
}
Ok(session::<G>(
remote_addr,