TCivetwebWSEngine.
Implementation of THttpWSEngine for Civetweb
Definition at line 32 of file TCivetweb.cxx.
|
| | TCivetwebWSEngine (struct mg_connection *conn) |
| |
| | ~TCivetwebWSEngine () override=default |
| |
| void | ClearHandle (Bool_t terminate) override |
| |
| UInt_t | GetId () const override |
| |
| virtual void | PostProcess (std::shared_ptr< THttpCallArg > &arg) |
| | Method invoked after user process data received via websocket.
|
| |
| 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.
|
| |
| void | Send (const void *buf, int len) override |
| |
| void | SendCharStar (const char *str) override |
| | Envelope for sending string via the websocket.
|
| |
| void | SendHeader (const char *hdr, const void *buf, int len) override |
| | Special method to send binary data with text header For normal websocket it is two separated operation, for other engines could be combined together, but emulates as two messages on client side.
|
| |
|
| virtual Bool_t | CanSendDirectly () |
| | One always can send data to websocket - as long as previous send operation completed.
|
| |
| Bool_t | SupportSendThrd () const override |
| | True websocket requires extra thread to parallelize sending.
|
| |
|
| std::condition_variable | fCond |
| | ! condition used to sync with sending thread
|
| |
| std::string | fData |
| | ! data (binary or text)
|
| |
| bool | fDisabled {false} |
| | ! true shortly before cleanup, set under locked fMutex from WSHandler
|
| |
| bool | fHasSendThrd {false} |
| | ! if thread was started one have to call join method for it
|
| |
| std::string | fHdr |
| | ! header
|
| |
| bool | fMTSend {false} |
| | ! true when send operation runs, set under locked fMutex from WSHandler
|
| |
| std::mutex | fMutex |
| | ! protects all data behind
|
| |
| bool | fSending {false} |
| | ! performing send operation in other thread
|
| |
| std::thread | fSendThrd |
| | ! dedicated thread for all send operations
|
| |
| bool | fWaiting {false} |
| | ! if condition wait is called
|
| |
| enum THttpWSEngine:: { ... } | kNone |
| | ! kind of operation
|
| |
◆ anonymous enum
◆ TCivetwebWSEngine()
| TCivetwebWSEngine::TCivetwebWSEngine |
( |
struct mg_connection * | conn | ) |
|
|
inline |
◆ ~TCivetwebWSEngine()
| TCivetwebWSEngine::~TCivetwebWSEngine |
( |
| ) |
|
|
overridedefault |
◆ CanSendDirectly()
| virtual Bool_t THttpWSEngine::CanSendDirectly |
( |
| ) |
|
|
inlineprotectedvirtualinherited |
◆ ClearHandle()
| void TCivetwebWSEngine::ClearHandle |
( |
Bool_t | terminate | ) |
|
|
inlineoverridevirtual |
◆ GetId()
| UInt_t TCivetwebWSEngine::GetId |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ PostProcess()
| void THttpWSEngine::PostProcess |
( |
std::shared_ptr< THttpCallArg > & | arg | ) |
|
|
virtualinherited |
◆ PreProcess()
Method should be invoked before processing data coming from websocket If method returns kTRUE, data is processed internally and not dedicated for further usage.
Reimplemented in THttpLongPollEngine.
Definition at line 40 of file THttpWSEngine.cxx.
◆ Send()
| void TCivetwebWSEngine::Send |
( |
const void * | buf, |
|
|
int | len ) |
|
inlineoverridevirtual |
◆ SendCharStar()
| void TCivetwebWSEngine::SendCharStar |
( |
const char * | str | ) |
|
|
inlineoverridevirtual |
◆ SendHeader()
| void TCivetwebWSEngine::SendHeader |
( |
const char * | hdr, |
|
|
const void * | buf, |
|
|
int | len ) |
|
inlineoverridevirtual |
Special method to send binary data with text header For normal websocket it is two separated operation, for other engines could be combined together, but emulates as two messages on client side.
Implements THttpWSEngine.
Definition at line 63 of file TCivetweb.cxx.
◆ SupportSendThrd()
| Bool_t TCivetwebWSEngine::SupportSendThrd |
( |
| ) |
const |
|
inlineoverrideprotectedvirtual |
◆ fCond
| std::condition_variable THttpWSEngine::fCond |
|
privateinherited |
! condition used to sync with sending thread
Definition at line 38 of file THttpWSEngine.h.
◆ fData
| std::string THttpWSEngine::fData |
|
privateinherited |
◆ fDisabled
| bool THttpWSEngine::fDisabled {false} |
|
privateinherited |
! true shortly before cleanup, set under locked fMutex from WSHandler
Definition at line 32 of file THttpWSEngine.h.
◆ fHasSendThrd
| bool THttpWSEngine::fHasSendThrd {false} |
|
privateinherited |
! if thread was started one have to call join method for it
Definition at line 35 of file THttpWSEngine.h.
◆ fHdr
| std::string THttpWSEngine::fHdr |
|
privateinherited |
◆ fMTSend
| bool THttpWSEngine::fMTSend {false} |
|
privateinherited |
! true when send operation runs, set under locked fMutex from WSHandler
Definition at line 31 of file THttpWSEngine.h.
◆ fMutex
| std::mutex THttpWSEngine::fMutex |
|
privateinherited |
◆ fSending
| bool THttpWSEngine::fSending {false} |
|
privateinherited |
! performing send operation in other thread
Definition at line 40 of file THttpWSEngine.h.
◆ fSendThrd
| std::thread THttpWSEngine::fSendThrd |
|
privateinherited |
! dedicated thread for all send operations
Definition at line 34 of file THttpWSEngine.h.
◆ fWaiting
| bool THttpWSEngine::fWaiting {false} |
|
privateinherited |
◆ fWSconn
◆ []
| enum { ... } THttpWSEngine::kNone |
net/http/src/TCivetweb.cxx