Logo ROOT  
Reference Guide
THttpLongPollEngine Class Reference

Definition at line 23 of file THttpLongPollEngine.h.

Public Member Functions

 THttpLongPollEngine (bool raw=false)
 constructor More...
 
virtual ~THttpLongPollEngine ()=default
 
void ClearHandle (Bool_t) override
 clear request, normally called shortly before destructor More...
 
UInt_t GetId () const override
 returns ID of the engine, created from this pointer More...
 
void PostProcess (std::shared_ptr< THttpCallArg > &arg) override
 Normally requests from client does not replied directly for longpoll socket Therefore one can use such request to send data, which was submitted before to the queue. More...
 
Bool_t PreProcess (std::shared_ptr< THttpCallArg > &arg) override
 Preview data for given socket Method called by WS handler before processing websocket data Returns kTRUE when user should ignore such http request - it is for internal use. More...
 
void Send (const void *buf, int len) override
 Send binary data via connection. More...
 
void SendCharStar (const char *buf) override
 Send const char data Either do it immediately or keep in internal buffer. More...
 
void SendHeader (const char *hdr, const void *buf, int len) override
 Send binary data with text header via connection. More...
 
- Public Member Functions inherited from THttpWSEngine
virtual ~THttpWSEngine ()=default
 
virtual void ClearHandle (Bool_t)=0
 
virtual UInt_t GetId () const =0
 
virtual void PostProcess (std::shared_ptr< THttpCallArg > &arg)
 Method invoked after user process data received via websocket. More...
 
virtual Bool_t PreProcess (std::shared_ptr< THttpCallArg > &arg)
 Method should be invoked before processing data coming from websocket If method returns kTRUE, data is processed internally and not dedicated for further usage. More...
 
virtual void Send (const void *buf, int len)=0
 
virtual void SendCharStar (const char *str)
 Envelope for sending string via the websocket. More...
 
virtual void SendHeader (const char *hdr, const void *buf, int len)=0
 

Protected Member Functions

virtual Bool_t CanSendDirectly () override
 Indicate that polling requests is there and can be immediately invoked. More...
 
std::string MakeBuffer (const void *buf, int len, const char *hdr=nullptr)
 !< default reply on the longpoll request More...
 
- Protected Member Functions inherited from THttpWSEngine
 THttpWSEngine ()=default
 
virtual Bool_t CanSendDirectly ()
 One always can send data to websocket - as long as previous send operation completed. More...
 
virtual Bool_t SupportSendThrd () const
 Indicate if engine require extra thread to complete postponed thread operation. More...
 

Protected Attributes

std::mutex fMutex
 !< if true, only content can be used for data transfer More...
 
std::shared_ptr< THttpCallArgfPoll
 !< protect polling request to use it from different threads More...
 
bool fRaw {false}
 

Static Protected Attributes

static const std::string gLongPollNope = "<<nope>>"
 !< hold polling request, which can be immediately used for the next sending More...
 

Friends

class THttpServer
 

#include </home/sftnight/build/workspace/root-makedoc-v620/rootspi/rdoc/src/v6-20-00-patches/net/http/src/THttpLongPollEngine.h>

Inheritance diagram for THttpLongPollEngine:
[legend]

Constructor & Destructor Documentation

◆ THttpLongPollEngine()

THttpLongPollEngine::THttpLongPollEngine ( bool  raw = false)

constructor

Definition at line 35 of file THttpLongPollEngine.cxx.

◆ ~THttpLongPollEngine()

virtual THttpLongPollEngine::~THttpLongPollEngine ( )
virtualdefault

Member Function Documentation

◆ CanSendDirectly()

Bool_t THttpLongPollEngine::CanSendDirectly ( )
overrideprotectedvirtual

Indicate that polling requests is there and can be immediately invoked.

Reimplemented from THttpWSEngine.

Definition at line 220 of file THttpLongPollEngine.cxx.

◆ ClearHandle()

void THttpLongPollEngine::ClearHandle ( Bool_t  )
overridevirtual

clear request, normally called shortly before destructor

Implements THttpWSEngine.

Definition at line 51 of file THttpLongPollEngine.cxx.

◆ GetId()

UInt_t THttpLongPollEngine::GetId ( ) const
overridevirtual

returns ID of the engine, created from this pointer

Implements THttpWSEngine.

Definition at line 42 of file THttpLongPollEngine.cxx.

◆ MakeBuffer()

std::string THttpLongPollEngine::MakeBuffer ( const void buf,
int  len,
const char *  hdr = nullptr 
)
protected

!< default reply on the longpoll request

Create raw buffer which should be send as reply For the raw mode all information must be send via binary response.

Definition at line 70 of file THttpLongPollEngine.cxx.

◆ PostProcess()

void THttpLongPollEngine::PostProcess ( std::shared_ptr< THttpCallArg > &  arg)
overridevirtual

Normally requests from client does not replied directly for longpoll socket Therefore one can use such request to send data, which was submitted before to the queue.

Reimplemented from THttpWSEngine.

Definition at line 211 of file THttpLongPollEngine.cxx.

◆ PreProcess()

Bool_t THttpLongPollEngine::PreProcess ( std::shared_ptr< THttpCallArg > &  arg)
overridevirtual

Preview data for given socket Method called by WS handler before processing websocket data Returns kTRUE when user should ignore such http request - it is for internal use.

Reimplemented from THttpWSEngine.

Definition at line 176 of file THttpLongPollEngine.cxx.

◆ Send()

void THttpLongPollEngine::Send ( const void buf,
int  len 
)
overridevirtual

Send binary data via connection.

Implements THttpWSEngine.

Definition at line 100 of file THttpLongPollEngine.cxx.

◆ SendCharStar()

void THttpLongPollEngine::SendCharStar ( const char *  buf)
overridevirtual

Send const char data Either do it immediately or keep in internal buffer.

Reimplemented from THttpWSEngine.

Definition at line 149 of file THttpLongPollEngine.cxx.

◆ SendHeader()

void THttpLongPollEngine::SendHeader ( const char *  hdr,
const void buf,
int  len 
)
overridevirtual

Send binary data with text header via connection.

Implements THttpWSEngine.

Definition at line 123 of file THttpLongPollEngine.cxx.

Friends And Related Function Documentation

◆ THttpServer

friend class THttpServer
friend

Definition at line 24 of file THttpLongPollEngine.h.

Member Data Documentation

◆ fMutex

std::mutex THttpLongPollEngine::fMutex
protected

!< if true, only content can be used for data transfer

Definition at line 29 of file THttpLongPollEngine.h.

◆ fPoll

std::shared_ptr<THttpCallArg> THttpLongPollEngine::fPoll
protected

!< protect polling request to use it from different threads

Definition at line 30 of file THttpLongPollEngine.h.

◆ fRaw

bool THttpLongPollEngine::fRaw {false}
protected

Definition at line 28 of file THttpLongPollEngine.h.

◆ gLongPollNope

const std::string THttpLongPollEngine::gLongPollNope = "<<nope>>"
staticprotected

!< hold polling request, which can be immediately used for the next sending

Definition at line 31 of file THttpLongPollEngine.h.


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