mirror of
https://github.com/EvernodeXRPL/hpcore.git
synced 2026-04-29 15:37:59 +00:00
* Precompiled header for all common library headers (with cmake 3.16rc3). * Divided cmake build into shared libraries. * Added gold linker support. * Separated websockets lambda expressions to an independent file.
37 lines
776 B
C++
37 lines
776 B
C++
#ifndef _HP_SOCKET_SESSION_HANDLER_
|
|
#define _HP_SOCKET_SESSION_HANDLER_
|
|
|
|
#include "socket_session.hpp"
|
|
|
|
namespace sock
|
|
{
|
|
|
|
// Forward declaration
|
|
template <class T>
|
|
class socket_session;
|
|
|
|
/**
|
|
* Represents a WebSocket sessions handler. Can inherit from this class and access websocket events
|
|
*/
|
|
template <class T>
|
|
class socket_session_handler
|
|
{
|
|
public:
|
|
/**
|
|
* Executes on initiation of a new connection
|
|
*/
|
|
virtual void on_connect(socket_session<T> *session) = 0;
|
|
|
|
/**
|
|
* Executes on recieval of new message
|
|
*/
|
|
virtual void on_message(socket_session<T> *session, std::string_view message) = 0;
|
|
|
|
/**
|
|
* Executes on websocket connection close
|
|
*/
|
|
virtual void on_close(socket_session<T> *session) = 0;
|
|
};
|
|
} // namespace sock
|
|
|
|
#endif |