From 1bb4c1bd80c3849312fffac9d5414cb0f8ed9311 Mon Sep 17 00:00:00 2001 From: Lara Dzivdzanovic Date: Thu, 2 Jan 2025 17:56:02 +0100 Subject: [PATCH] Add start() method #4833 --- Net/include/Poco/Net/SocketReactor.h | 3 +++ Net/src/SocketReactor.cpp | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/Net/include/Poco/Net/SocketReactor.h b/Net/include/Poco/Net/SocketReactor.h index cd14d9615..57aa51b91 100644 --- a/Net/include/Poco/Net/SocketReactor.h +++ b/Net/include/Poco/Net/SocketReactor.h @@ -186,6 +186,9 @@ public: /// until stop() is called (in a separate thread). /// Can be overriden by inheriting classes. + void start(); + /// Starts the SocketReactor. + void stop(); /// Stops the SocketReactor. /// diff --git a/Net/src/SocketReactor.cpp b/Net/src/SocketReactor.cpp index 41e9250ea..0aebd5bb3 100644 --- a/Net/src/SocketReactor.cpp +++ b/Net/src/SocketReactor.cpp @@ -157,6 +157,12 @@ void SocketReactor::sleep() } +void SocketReactor::start() +{ + _stop.exchange(false); +} + + void SocketReactor::stop() { if (_stop.exchange(true)) return;