From 23db39a84e624907584ccccd45ac313c7f929c8b Mon Sep 17 00:00:00 2001 From: Siavash Sameni Date: Wed, 1 Apr 2026 10:19:15 +0400 Subject: [PATCH] Add CSV output to server mode Server now writes a CSV row for each completed test with peer IP, protocol, direction, duration, avg speeds, bytes, and lost packets. Verified on loopback: TX 35 Gbps, RX 51 Gbps captured in CSV. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/server.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/server.rs b/src/server.rs index 57219f2..0a39fbc 100644 --- a/src/server.rs +++ b/src/server.rs @@ -354,6 +354,12 @@ async fn handle_client( &peer.to_string(), proto_str, dir_str, total_tx, total_rx, total_lost, intervals, ); + if crate::csv_output::is_enabled() { + crate::csv_output::write_result( + &peer.ip().to_string(), peer.port(), proto_str, dir_str, + intervals as u64, total_tx, total_rx, total_lost, auth_type, + ); + } result.map(|_| ()) }