From 8a1bed751d77d0e38fb2cc8612e7872bc68ec6ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Stoj=C5=A1in?= Date: Sat, 15 Jun 2024 18:04:58 +0200 Subject: [PATCH] Reset the IO context before starting - fixes reconnect bug where the context doesn't restart --- include/libnetwrk/net/core/shared/shared_context.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/libnetwrk/net/core/shared/shared_context.hpp b/include/libnetwrk/net/core/shared/shared_context.hpp index 86bdb64..9af2e89 100644 --- a/include/libnetwrk/net/core/shared/shared_context.hpp +++ b/include/libnetwrk/net/core/shared/shared_context.hpp @@ -54,6 +54,8 @@ namespace libnetwrk { } void start_io_context() { + io_context.reset(); + m_io_context_thread = std::thread([this] { this->io_context.run(); });