diff --git a/net/Socket.cpp b/net/Socket.cpp index 74a0dff16..5c133b33a 100644 --- a/net/Socket.cpp +++ b/net/Socket.cpp @@ -153,6 +153,32 @@ void SocketPoll::feed(const std::string& payload) #endif +void SocketPoll::pollingThreadEntry() +{ + try + { + Util::setThreadName(_name); + LOG_INF("Starting polling thread [" << _name << "]."); + + _owner = std::this_thread::get_id(); + LOG_DBG("Thread affinity of " << _name << " set to " << + Log::to_string(_owner) << "."); + + // Invoke the virtual implementation. + pollingThread(); + + // Release sockets. + _pollSockets.clear(); + _newSockets.clear(); + } + catch (const std::exception& exc) + { + LOG_ERR("Exception in polling thread [" << _name << "]: " << exc.what()); + } + + _threadFinished = true; +} + void SocketPoll::wakeupWorld() { #ifndef MOBILEAPP diff --git a/net/Socket.hpp b/net/Socket.hpp index 074734ca9..3e86055e0 100644 --- a/net/Socket.hpp +++ b/net/Socket.hpp @@ -675,31 +675,7 @@ private: /// The polling thread entry. /// Used to set the thread name and mark the thread as stopped when done. - void pollingThreadEntry() - { - try - { - Util::setThreadName(_name); - LOG_INF("Starting polling thread [" << _name << "]."); - - _owner = std::this_thread::get_id(); - LOG_DBG("Thread affinity of " << _name << " set to " << - Log::to_string(_owner) << "."); - - // Invoke the virtual implementation. - pollingThread(); - - // Release sockets. - _pollSockets.clear(); - _newSockets.clear(); - } - catch (const std::exception& exc) - { - LOG_ERR("Exception in polling thread [" << _name << "]: " << exc.what()); - } - - _threadFinished = true; - } + void pollingThreadEntry(); private: /// Debug name used for logging.