summaryrefslogtreecommitdiff
path: root/src/components/hmi_message_handler/src/websocket_session.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/hmi_message_handler/src/websocket_session.cc')
-rw-r--r--src/components/hmi_message_handler/src/websocket_session.cc14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/components/hmi_message_handler/src/websocket_session.cc b/src/components/hmi_message_handler/src/websocket_session.cc
index 3484278c1a..84c786fac3 100644
--- a/src/components/hmi_message_handler/src/websocket_session.cc
+++ b/src/components/hmi_message_handler/src/websocket_session.cc
@@ -30,18 +30,12 @@ namespace NsMessageBroker
shared_from_this(), std::placeholders::_1)));
}
- void WebsocketSession::Close() {
- ws_.async_close({}, [](boost::system::error_code){});
- }
-
void WebsocketSession::Shutdown() {
shutdown_ = true;
thread_delegate_->SetShutdown();
thread_->join();
delete thread_delegate_;
threads::DeleteThread(thread_);
- Close();
-
}
bool WebsocketSession::IsShuttingDown() {
@@ -314,7 +308,9 @@ namespace NsMessageBroker
void WebsocketSession::LoopThreadDelegate::exitThreadMain() {
shutdown_= true;
- message_queue_.Shutdown();
+ if(!message_queue_.IsShuttingDown()) {
+ message_queue_.Shutdown();
+ }
}
void WebsocketSession::LoopThreadDelegate::DrainQueue() {
@@ -329,6 +325,8 @@ namespace NsMessageBroker
void WebsocketSession::LoopThreadDelegate::SetShutdown(){
shutdown_ = true;
- message_queue_.Shutdown();
+ if(!message_queue_.IsShuttingDown()) {
+ message_queue_.Shutdown();
+ }
}
} \ No newline at end of file