File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -95,6 +95,14 @@ pub fn start_dap(
9595 Ok ( ( stream, addr) ) => {
9696 log:: info!( "DAP: Connected to client {addr:?}" ) ;
9797
98+ // Disable Nagle's algorithm to ensure events are sent immediately.
99+ // Without this, small writes may be buffered at the TCP level,
100+ // causing events to not reach the client until more data is sent.
101+ // This was observed to cause hangs on Windows ARM.
102+ if let Err ( err) = stream. set_nodelay ( true ) {
103+ log:: warn!( "DAP: Failed to set TCP_NODELAY: {err:?}" ) ;
104+ }
105+
98106 let mut state = state. lock ( ) . unwrap ( ) ;
99107 state. is_connected = true ;
100108
Original file line number Diff line number Diff line change @@ -69,6 +69,10 @@ impl DapClient {
6969 stream. set_read_timeout ( Some ( DEFAULT_TIMEOUT ) ) ?;
7070 stream. set_write_timeout ( Some ( DEFAULT_TIMEOUT ) ) ?;
7171
72+ // Disable Nagle's algorithm to ensure messages are sent immediately.
73+ // This matches the server-side setting and prevents buffering delays.
74+ stream. set_nodelay ( true ) ?;
75+
7276 let reader = BufReader :: new ( stream. try_clone ( ) ?) ;
7377 let writer = BufWriter :: new ( stream) ;
7478
You can’t perform that action at this time.
0 commit comments