Added a method to send to all subscribers on subscription.
This commit is contained in:
parent
e78f0cd4f8
commit
cb2a61bed9
@ -70,4 +70,12 @@ namespace core {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Subscription::sendToAll(std::stringstream &data, TCPSession &sender) {
|
||||||
|
for (auto session : subscribers)
|
||||||
|
if (session != &sender)
|
||||||
|
session->write(data.str());
|
||||||
|
data.str("");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -32,6 +32,8 @@ namespace core
|
|||||||
|
|
||||||
bool subInvite(TCPSession &session);
|
bool subInvite(TCPSession &session);
|
||||||
|
|
||||||
|
void sendToAll(std::stringstream &data, TCPSession &sender);
|
||||||
|
|
||||||
std::string id;
|
std::string id;
|
||||||
std::string mode;
|
std::string mode;
|
||||||
TCPSession *owner;
|
TCPSession *owner;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user