diff --git a/Net/include/Poco/Net/SocketReactor.h b/Net/include/Poco/Net/SocketReactor.h index cd14d96150..57aa51b916 100644 --- a/Net/include/Poco/Net/SocketReactor.h +++ b/Net/include/Poco/Net/SocketReactor.h @@ -186,6 +186,9 @@ class Net_API SocketReactor: public Poco::Runnable /// 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 41e9250ea4..0aebd5bb37 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;