From dde24214fecb1178f5c130f09ad162a1e5847877 Mon Sep 17 00:00:00 2001
From: zhaomingwork <61895407+zhaomingwork@users.noreply.github.com>
Date: 星期三, 14 六月 2023 11:06:07 +0800
Subject: [PATCH] fix cpp ws client not exit when finished problem (#628)

---
 funasr/runtime/websocket/funasr-ws-client.cpp |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/funasr/runtime/websocket/funasr-ws-client.cpp b/funasr/runtime/websocket/funasr-ws-client.cpp
index 2691b26..23c68cc 100644
--- a/funasr/runtime/websocket/funasr-ws-client.cpp
+++ b/funasr/runtime/websocket/funasr-ws-client.cpp
@@ -132,8 +132,14 @@
             }
             send_wav_data(wav_list[i], wav_ids[i]);
         }
+        WaitABit();
+		m_client.close(m_hdl,websocketpp::close::status::going_away, "", ec);
+        if (ec) {
+                std::cout << "> Error closing connection " << ec.message() << std::endl;
+            }
         //send_wav_data();
         asio_thread.join();
+
     }
 
     // The open handler will signal that we are ready to start sending data

--
Gitblit v1.9.1