fix: client exits after --send-tone completes (was hanging on recv task)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -509,12 +509,13 @@ async fn run_file_mode(
|
|||||||
let all_pcm = if record_file.is_some() {
|
let all_pcm = if record_file.is_some() {
|
||||||
// Wait a bit for remaining packets after sender finishes
|
// Wait a bit for remaining packets after sender finishes
|
||||||
tokio::time::sleep(tokio::time::Duration::from_secs(2)).await;
|
tokio::time::sleep(tokio::time::Duration::from_secs(2)).await;
|
||||||
// The recv task will be aborted when we drop it, but first
|
|
||||||
// let's signal it by closing transport
|
|
||||||
transport.close().await?;
|
transport.close().await?;
|
||||||
recv_handle.await.unwrap_or_default()
|
recv_handle.await.unwrap_or_default()
|
||||||
} else {
|
} else {
|
||||||
recv_handle.await.unwrap_or_default()
|
// No recording — just close and exit
|
||||||
|
transport.close().await?;
|
||||||
|
recv_handle.abort();
|
||||||
|
Vec::new()
|
||||||
};
|
};
|
||||||
|
|
||||||
// Write recorded audio to file
|
// Write recorded audio to file
|
||||||
|
|||||||
Reference in New Issue
Block a user