|
Orbit Framework
An ultra-modern, asynchronous, cross-platform C++ Web Framework.
|
A Socket.IO style event router for WebSockets with Room and Session support. More...
#include <EventRouter.hpp>
Classes | |
| struct | RoomBroadcaster |
Public Types | |
| using | SocketPtr = std::shared_ptr< EventSocket< SessionType > > |
Public Member Functions | |
| template<typename PayloadType > | |
| void | on (const std::string &event, std::function< void(EventSocket< SessionType > &, const PayloadType &)> handler) |
| void | on (const std::string &event, std::function< void(EventSocket< SessionType > &)> handler) |
| Registers an untyped event handler (no data expected). | |
| void | on_connect (std::function< void(EventSocket< SessionType > &)> handler) |
| Registers a connection handler. | |
| void | on_disconnect (std::function< void(EventSocket< SessionType > &)> handler) |
| Registers a disconnection handler. | |
| void | attach (server::App &app, const std::string &path) |
| Attaches this EventRouter to the Orbit App at a specific path. | |
| RoomBroadcaster | to (const std::string &room) |
| void | join_room (const std::string &id, const std::string &room) |
| void | leave_room (const std::string &id, const std::string &room) |
| void | broadcast_to_room (const std::string &room, const std::string &msg) |
A Socket.IO style event router for WebSockets with Room and Session support.
| using websocket::EventRouter< SessionType >::SocketPtr = std::shared_ptr<EventSocket<SessionType> > |
|
inline |
Attaches this EventRouter to the Orbit App at a specific path.
|
inline |
|
inline |
|
inline |
|
inline |
Registers an untyped event handler (no data expected).
|
inline |
|
inline |
Registers a connection handler.
|
inline |
Registers a disconnection handler.
|
inline |