mirror of
https://github.com/mii443/libdatachannel.git
synced 2025-08-29 18:39:31 +00:00
Do not receive messages in onMessage is not set
This commit is contained in:
@ -60,15 +60,17 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
void operator()(P... args) {
|
||||
void operator()(P... args) const {
|
||||
std::lock_guard<std::recursive_mutex> lock(mutex);
|
||||
if (callback)
|
||||
callback(args...);
|
||||
}
|
||||
|
||||
operator bool() const { return callback ? true : false; }
|
||||
|
||||
private:
|
||||
std::function<void(P...)> callback;
|
||||
std::recursive_mutex mutex;
|
||||
mutable std::recursive_mutex mutex;
|
||||
};
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user