Create TCPSession2 for outpubound connections.
This commit is contained in:
1 parent
5c87225c6f
commit
fd70c79282
129 files changed
+1902
-710
No files matched your search
@@ -5,19 +5,19 @@
|
||||
namespace core {
|
||||
|
||||
SubscriptionManager::SubscriptionManager() {}
|
||||
|
||||
|
||||
int SubscriptionManager::add(Subscription &subscription) {
|
||||
lock.lock();
|
||||
subscriptions.insert(std::make_pair(subscription.id, &subscription));
|
||||
lock.unlock();
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
int SubscriptionManager::removeSessionSubscriptions(TCPSession &session) {
|
||||
int countSubscribed = 0;
|
||||
int countPublished = 0;
|
||||
|
||||
lock.lock();
|
||||
lock.lock();
|
||||
std::string temp = "";
|
||||
for(auto [key, subscription] : subscriptions) {
|
||||
if(temp != "") {
|
||||
@@ -29,14 +29,14 @@ namespace core {
|
||||
temp = key;
|
||||
delete subscription;
|
||||
++countPublished;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(temp != "") {
|
||||
subscriptions.erase(temp);
|
||||
temp = "";
|
||||
}
|
||||
coreutils::Log(coreutils::LOG_DEBUG_2) << "Removed session from " << countSubscribed << " subscription(s).";
|
||||
coreutils::Log(coreutils::LOG_DEBUG_2) << "Cancelled " << countPublished << " channel(s) for session.";
|
||||
// coreutils::Log(coreutils::LOG_DEBUG_2) << "Removed session from " << countSubscribed << " subscription(s).";
|
||||
// coreutils::Log(coreutils::LOG_DEBUG_2) << "Cancelled " << countPublished << " channel(s) for session.";
|
||||
lock.unlock();
|
||||
return countSubscribed;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user