Orbit Framework
An ultra-modern, asynchronous, cross-platform C++ Web Framework.
Loading...
Searching...
No Matches
websocket::EventSocket< SessionType > Class Template Reference

Represents a connected client in the EventRouter. More...

#include <EventRouter.hpp>

Public Member Functions

 EventSocket (http::websocket::WebSocketConnection &raw, EventRouter< SessionType > &router, std::string id)
 
template<typename T >
void emit (const std::string &event, const T &data)
 Emits an event with strongly-typed data back to this specific client.
 
void join (const std::string &room)
 Joins a specific room/channel.
 
void leave (const std::string &room)
 Leaves a specific room/channel.
 
auto to (const std::string &room)
 Returns a broadcaster to emit messages to everyone in the room.
 
SessionTypesession ()
 The strongly-typed session state attached to this connection.
 
const std::string & id () const
 
http::websocket::WebSocketConnectionraw ()
 

Friends

class EventRouter< SessionType >
 

Detailed Description

template<typename SessionType>
class websocket::EventSocket< SessionType >

Represents a connected client in the EventRouter.

Constructor & Destructor Documentation

◆ EventSocket()

template<typename SessionType >
websocket::EventSocket< SessionType >::EventSocket ( http::websocket::WebSocketConnection raw,
EventRouter< SessionType > &  router,
std::string  id 
)
inline

Member Function Documentation

◆ emit()

template<typename SessionType >
template<typename T >
void websocket::EventSocket< SessionType >::emit ( const std::string &  event,
const T data 
)
inline

Emits an event with strongly-typed data back to this specific client.

Examples
/home/runner/work/orbit-framework/orbit-framework/include/orbit/websocket/EventRouter.hpp.

◆ id()

◆ join()

◆ leave()

◆ raw()

◆ session()

template<typename SessionType >
SessionType & websocket::EventSocket< SessionType >::session ( )
inline

The strongly-typed session state attached to this connection.

Examples
/home/runner/work/orbit-framework/orbit-framework/include/orbit/websocket/EventRouter.hpp.

◆ to()

template<typename SessionType >
auto websocket::EventSocket< SessionType >::to ( const std::string &  room)

Returns a broadcaster to emit messages to everyone in the room.

Examples
/home/runner/work/orbit-framework/orbit-framework/include/orbit/websocket/EventRouter.hpp.

Friends And Related Symbol Documentation

◆ EventRouter< SessionType >


The documentation for this class was generated from the following file: