12#ifndef ROOT_THttpLongPollEngine
13#define ROOT_THttpLongPollEngine
30 std::shared_ptr<THttpCallArg>
fPoll;
33 std::string
MakeBuffer(
const void *buf,
int len,
const char *hdr =
nullptr);
45 void Send(
const void *buf,
int len)
override;
49 void SendHeader(
const char *hdr,
const void *buf,
int len)
override;
53 void PostProcess(std::shared_ptr<THttpCallArg> &arg)
override;
std::string MakeBuffer(const void *buf, int len, const char *hdr=nullptr)
!< default reply on the longpoll request
std::shared_ptr< THttpCallArg > fPoll
!< protect polling request to use it from different threads
void Send(const void *buf, int len) override
Send binary data via connection.
void SendHeader(const char *hdr, const void *buf, int len) override
Send binary data with text header via connection.
std::mutex fMutex
!< if true, only content can be used for data transfer
virtual Bool_t CanSendDirectly() override
Indicate that polling requests is there and can be immediately invoked.
THttpLongPollEngine(bool raw=false)
constructor
static const std::string gLongPollNope
!< hold polling request, which can be immediately used for the next sending
void ClearHandle(Bool_t) override
clear request, normally called shortly before destructor
void SendCharStar(const char *buf) override
Send const char data Either do it immediately or keep in internal buffer.
Bool_t PreProcess(std::shared_ptr< THttpCallArg > &arg) override
Preview data for given socket Method called by WS handler before processing websocket data Returns kT...
UInt_t GetId() const override
returns ID of the engine, created from this pointer
void PostProcess(std::shared_ptr< THttpCallArg > &arg) override
Normally requests from client does not replied directly for longpoll socket Therefore one can use suc...
virtual ~THttpLongPollEngine()=default