diff --git a/bcos-boostssl/websocket/WsService.cpp b/bcos-boostssl/websocket/WsService.cpp index d413f9d..3c2c0e1 100644 --- a/bcos-boostssl/websocket/WsService.cpp +++ b/bcos-boostssl/websocket/WsService.cpp @@ -137,21 +137,24 @@ void WsService::stop() } m_running = false; - // stop ioc thread - if (m_ioservicePool) - { - m_ioservicePool->stop(); - } - if (m_statTimer) { m_statTimer->stop(); } + if (m_timerFactory) + { + m_timerFactory.reset(); + } if (m_reconnectTimer) { m_reconnectTimer->stop(); } + // stop ioc thread + if (m_ioservicePool) + { + m_ioservicePool->stop(); + } WEBSOCKET_SERVICE(INFO) << LOG_BADGE("stop") << LOG_DESC("stop websocket service successfully"); } @@ -309,7 +312,7 @@ void WsService::reconnect() { std::string connectedEndPoint = peer.detail(); auto session = getSession(connectedEndPoint); - if (session) + if (session && session->isConnected()) { continue; } diff --git a/cmake/CompilerSettings.cmake b/cmake/CompilerSettings.cmake index 71def24..428b596 100644 --- a/cmake/CompilerSettings.cmake +++ b/cmake/CompilerSettings.cmake @@ -83,11 +83,16 @@ if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MA option(USE_LD_GOLD "Use GNU gold linker" ON) if (USE_LD_GOLD) - execute_process(COMMAND ${CMAKE_C_COMPILER} -fuse-ld=gold -Wl,--version ERROR_QUIET OUTPUT_VARIABLE LD_VERSION) - if ("${LD_VERSION}" MATCHES "GNU gold") - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold") - set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fuse-ld=gold") - endif () + if("${LINKER}" MATCHES "gold") + execute_process(COMMAND ${CMAKE_C_COMPILER} -fuse-ld=gold -Wl,--version ERROR_QUIET OUTPUT_VARIABLE LD_VERSION) + if("${LD_VERSION}" MATCHES "GNU gold") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold") + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fuse-ld=gold") + endif() + elseif("${LINKER}" MATCHES "mold") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=mold") + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fuse-ld=mold") + endif() endif () # Additional GCC-specific compiler settings.