thread accepting connections can be cancelled/stopped externally
This commit is contained in:
1 parent
ead54d6c37
commit
7c4f14f941
3 files changed
+34
-6
No files matched your search
@@ -13,6 +13,7 @@
|
||||
#include <mutex>
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <condition_variable>
|
||||
|
||||
#include "IXWebSocket.h"
|
||||
|
||||
@@ -29,6 +30,7 @@ namespace ix
|
||||
|
||||
void setOnConnectionCallback(const OnConnectionCallback& callback);
|
||||
void start();
|
||||
void wait();
|
||||
|
||||
std::pair<bool, std::string> listen();
|
||||
|
||||
@@ -54,6 +56,9 @@ namespace ix
|
||||
std::atomic<bool> _stop;
|
||||
std::thread _thread;
|
||||
|
||||
std::condition_variable _conditionVariable;
|
||||
std::mutex _conditionVariableMutex;
|
||||
|
||||
const static std::string kDefaultHost;
|
||||
|
||||
// Methods
|
||||
|
||||
Reference in new issue
Block a user