SNode.C
|
#include <SubProtocol.h>
Public Member Functions | |
~SubProtocol () override | |
void | subscribe (const std::string &group) |
void | sendBroadcast (const char *message, std::size_t messageLength, bool excludeSelf=false) |
void | sendBroadcast (const std::string &message, bool excludeSelf=false) |
void | sendBroadcastStart (const char *message, std::size_t messageLength, bool excludeSelf=false) |
void | sendBroadcastStart (const std::string &message, bool excludeSelf=false) |
void | sendBroadcastFrame (const char *message, std::size_t messageLength, bool excludeSelf=false) |
void | sendBroadcastFrame (const std::string &message, bool excludeSelf=false) |
void | sendBroadcastEnd (const char *message, std::size_t messageLength, bool excludeSelf=false) |
void | sendBroadcastEnd (const std::string &message, bool excludeSelf=false) |
void | forEachClient (const std::function< void(const SubProtocol *)> &sendToClient, bool excludeSelf=false) |
![]() | |
SubProtocol (SubProtocol &)=delete | |
SubProtocol (SubProtocol &&)=delete | |
SubProtocol & | operator= (SubProtocol &)=delete |
SubProtocol & | operator= (SubProtocol &&)=delete |
void | sendMessage (const char *message, std::size_t messageLength) const |
void | sendMessage (const std::string &message) const |
void | sendMessageStart (const char *message, std::size_t messageLength) const |
void | sendMessageStart (const std::string &message) const |
void | sendMessageFrame (const char *message, std::size_t messageLength) const |
void | sendMessageFrame (const std::string &message) const |
void | sendMessageEnd (const char *message, std::size_t messageLength) const |
void | sendMessageEnd (const std::string &message) const |
void | sendPing (const char *reason=nullptr, std::size_t reasonLength=0) const |
void | sendClose (uint16_t statusCode=1000, const char *reason=nullptr, std::size_t reasonLength=0) |
const std::string & | getName () |
core::socket::stream::SocketConnection * | getSocketConnection () const |
Protected Member Functions | |
SubProtocol (SubProtocolContext *subProtocolContext, const std::string &name, int pingInterval=0, int maxFlyingPings=3) | |
![]() | |
SubProtocol (SubProtocolContext *subProtocolContext, const std::string &name, int pingInterval=60, int maxFlyingPings=3) | |
Private Types | |
using | Super = web::websocket::SubProtocol< web::websocket::server::SocketContextUpgrade > |
Private Attributes | |
std::string | group |
Friends | |
template<typename RequestT , typename ResponseT , typename SubProtocolT > | |
class | web::websocket::SocketContextUpgrade |
class | GroupsManager |
Additional Inherited Members | |
![]() | |
SubProtocolContext * | subProtocolContext |
Definition at line 63 of file SubProtocol.h.
|
private |
Definition at line 65 of file SubProtocol.h.
|
protected |
Definition at line 53 of file SubProtocol.cpp.
References web::websocket::server::GroupsManager::instance(), web::websocket::SubProtocol< SocketContextUpgradeT >::SubProtocol(), and web::websocket::server::GroupsManager::subscribe().
Referenced by apps::websocket::subprotocol::echo::server::Echo::Echo().
|
overridevirtual |
Reimplemented from web::websocket::SubProtocol< web::websocket::server::SocketContextUpgrade >.
Definition at line 58 of file SubProtocol.cpp.
References web::websocket::server::GroupsManager::instance(), and web::websocket::server::GroupsManager::unsubscribe().
void web::websocket::server::SubProtocol::forEachClient | ( | const std::function< void(const SubProtocol *)> & | sendToClient, |
bool | excludeSelf = false |
||
) |
Definition at line 101 of file SubProtocol.cpp.
References web::websocket::server::GroupsManager::forEachClient(), group, and web::websocket::server::GroupsManager::instance().
void web::websocket::server::SubProtocol::sendBroadcast | ( | const char * | message, |
std::size_t | messageLength, | ||
bool | excludeSelf = false |
||
) |
Definition at line 73 of file SubProtocol.cpp.
References group, web::websocket::server::GroupsManager::instance(), and web::websocket::server::GroupsManager::sendBroadcast().
void web::websocket::server::SubProtocol::sendBroadcast | ( | const std::string & | message, |
bool | excludeSelf = false |
||
) |
Definition at line 69 of file SubProtocol.cpp.
References group, web::websocket::server::GroupsManager::instance(), and web::websocket::server::GroupsManager::sendBroadcast().
Referenced by apps::websocket::subprotocol::echo::server::Echo::onMessageEnd().
void web::websocket::server::SubProtocol::sendBroadcastEnd | ( | const char * | message, |
std::size_t | messageLength, | ||
bool | excludeSelf = false |
||
) |
Definition at line 93 of file SubProtocol.cpp.
References group, web::websocket::server::GroupsManager::instance(), and web::websocket::server::GroupsManager::sendBroadcastEnd().
void web::websocket::server::SubProtocol::sendBroadcastEnd | ( | const std::string & | message, |
bool | excludeSelf = false |
||
) |
Definition at line 97 of file SubProtocol.cpp.
References group, web::websocket::server::GroupsManager::instance(), and web::websocket::server::GroupsManager::sendBroadcastEnd().
void web::websocket::server::SubProtocol::sendBroadcastFrame | ( | const char * | message, |
std::size_t | messageLength, | ||
bool | excludeSelf = false |
||
) |
Definition at line 85 of file SubProtocol.cpp.
References group, web::websocket::server::GroupsManager::instance(), and web::websocket::server::GroupsManager::sendBroadcastFrame().
void web::websocket::server::SubProtocol::sendBroadcastFrame | ( | const std::string & | message, |
bool | excludeSelf = false |
||
) |
Definition at line 89 of file SubProtocol.cpp.
References group, web::websocket::server::GroupsManager::instance(), and web::websocket::server::GroupsManager::sendBroadcastFrame().
void web::websocket::server::SubProtocol::sendBroadcastStart | ( | const char * | message, |
std::size_t | messageLength, | ||
bool | excludeSelf = false |
||
) |
Definition at line 77 of file SubProtocol.cpp.
References group, web::websocket::server::GroupsManager::instance(), and web::websocket::server::GroupsManager::sendBroadcastStart().
void web::websocket::server::SubProtocol::sendBroadcastStart | ( | const std::string & | message, |
bool | excludeSelf = false |
||
) |
Definition at line 81 of file SubProtocol.cpp.
References group, web::websocket::server::GroupsManager::instance(), and web::websocket::server::GroupsManager::sendBroadcastStart().
void web::websocket::server::SubProtocol::subscribe | ( | const std::string & | group | ) |
Definition at line 62 of file SubProtocol.cpp.
References web::websocket::server::GroupsManager::instance(), and web::websocket::server::GroupsManager::subscribe().
|
friend |
Definition at line 104 of file SubProtocol.h.
|
friend |
Definition at line 102 of file SubProtocol.h.
|
private |
Definition at line 99 of file SubProtocol.h.
Referenced by forEachClient(), sendBroadcast(), sendBroadcast(), sendBroadcastEnd(), sendBroadcastEnd(), sendBroadcastFrame(), sendBroadcastFrame(), sendBroadcastStart(), sendBroadcastStart(), web::websocket::server::GroupsManager::subscribe(), and web::websocket::server::GroupsManager::unsubscribe().