From e02062443b02c6627d4679b82b00aa5e1056f457 Mon Sep 17 00:00:00 2001
From: 雾聪 <wucong.lyb@alibaba-inc.com>
Date: 星期四, 10 八月 2023 19:55:50 +0800
Subject: [PATCH] update websocket-server-2pass

---
 funasr/runtime/websocket/websocket-server-2pass.cpp |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/funasr/runtime/websocket/websocket-server-2pass.cpp b/funasr/runtime/websocket/websocket-server-2pass.cpp
index 50f0edc..82beb1c 100644
--- a/funasr/runtime/websocket/websocket-server-2pass.cpp
+++ b/funasr/runtime/websocket/websocket-server-2pass.cpp
@@ -180,7 +180,11 @@
 
 void WebSocketServer::on_open(websocketpp::connection_hdl hdl) {
   scoped_lock guard(m_lock);     // for threads safty
-  check_and_clean_connection();  // remove closed connection
+  try{
+    check_and_clean_connection();  // remove closed connection 
+  }catch (std::exception const& e) {
+    std::cerr << "Error: " << e.what() << std::endl;
+  }
 
   std::shared_ptr<FUNASR_MESSAGE> data_msg =
       std::make_shared<FUNASR_MESSAGE>();  // put a new data vector for new

--
Gitblit v1.9.1