12#ifndef ROOT_THttpWSEngine
13#define ROOT_THttpWSEngine
22#include <condition_variable>
61 virtual void Send(
const void *buf,
int len) = 0;
63 virtual void SendHeader(
const char *hdr,
const void *buf,
int len) = 0;
69 virtual void PostProcess(std::shared_ptr<THttpCallArg> &arg);
bool fMTSend
! true when send operation runs, set under locked fMutex from WSHandler
virtual Bool_t PreProcess(std::shared_ptr< THttpCallArg > &arg)
Method should be invoked before processing data coming from websocket If method returns kTRUE,...
std::condition_variable fCond
! condition used to sync with sending thread
bool fDoingSend
! doing send operation in other thread
virtual void SendCharStar(const char *str)
Envelope for sending string via the websocket.
virtual UInt_t GetId() const =0
std::thread fSendThrd
! dedicated thread for all send operations
bool fHasSendThrd
! if thread was started one have to call join method for it
std::mutex fCondMutex
! mutex used to access condition
bool fDisabled
! true shortly before cleanup, set under locked fMutex from WSHandler
virtual void SendHeader(const char *hdr, const void *buf, int len)=0
enum THttpWSEngine::@144 kNone
! kind of operation
virtual Bool_t CanSendDirectly()
One always can send data to websocket - as long as previous send operation completed.
virtual void PostProcess(std::shared_ptr< THttpCallArg > &arg)
Method invoked after user process data received via websocket.
virtual Bool_t SupportSendThrd() const
Indicate if engine require extra thread to complete postponed thread operation.
std::mutex fDataMutex
! protects data submitted for send operation
virtual void Send(const void *buf, int len)=0
std::string fData
! data (binary or text)
virtual ~THttpWSEngine()=default
virtual void ClearHandle(Bool_t)=0