Internal instance used to exchange WS functionality between THttpServer and THttpWSHandler.
Normally should not be used directly
Definition at line 26 of file THttpWSEngine.h.
Public Member Functions | |
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. | |
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. | |
virtual void | Send (const void *buf, int len)=0 |
virtual void | SendCharStar (const char *str) |
Envelope for sending string via the websocket. | |
virtual void | SendHeader (const char *hdr, const void *buf, int len)=0 |
Protected Member Functions | |
THttpWSEngine ()=default | |
virtual Bool_t | CanSendDirectly () |
One always can send data to websocket - as long as previous send operation completed. | |
virtual Bool_t | SupportSendThrd () const |
Indicate if engine require extra thread to complete postponed thread operation. | |
Private Types | |
enum | { kNone , kData , kHeader , kText } |
Private Attributes | |
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 | |
Friends | |
class | THttpWSHandler |
#include </github/home/ROOT-CI/src/net/http/src/THttpWSEngine.h>
Enumerator | |
---|---|
kNone | |
kData | |
kHeader | |
kText |
Definition at line 41 of file THttpWSEngine.h.
|
protecteddefault |
|
virtualdefault |
One always can send data to websocket - as long as previous send operation completed.
Reimplemented in THttpLongPollEngine.
Definition at line 52 of file THttpWSEngine.h.
Implemented in TCivetwebWSEngine, and THttpLongPollEngine.
Implemented in TCivetwebWSEngine, and THttpLongPollEngine.
|
virtual |
Method invoked after user process data received via websocket.
Reimplemented in THttpLongPollEngine.
Definition at line 48 of file THttpWSEngine.cxx.
|
virtual |
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.
Implemented in TCivetwebWSEngine, and THttpLongPollEngine.
|
virtual |
Envelope for sending string via the websocket.
Reimplemented in THttpLongPollEngine, and TCivetwebWSEngine.
Definition at line 29 of file THttpWSEngine.cxx.
Implemented in TCivetwebWSEngine, and THttpLongPollEngine.
Indicate if engine require extra thread to complete postponed thread operation.
Reimplemented in TCivetwebWSEngine.
Definition at line 49 of file THttpWSEngine.h.
|
friend |
Definition at line 29 of file THttpWSEngine.h.
|
private |
! condition used to sync with sending thread
Definition at line 38 of file THttpWSEngine.h.
|
private |
! data (binary or text)
Definition at line 42 of file THttpWSEngine.h.
! true shortly before cleanup, set under locked fMutex from WSHandler
Definition at line 32 of file THttpWSEngine.h.
! if thread was started one have to call join method for it
Definition at line 35 of file THttpWSEngine.h.
|
private |
! header
Definition at line 43 of file THttpWSEngine.h.
! true when send operation runs, set under locked fMutex from WSHandler
Definition at line 31 of file THttpWSEngine.h.
|
private |
! protects all data behind
Definition at line 37 of file THttpWSEngine.h.
! performing send operation in other thread
Definition at line 40 of file THttpWSEngine.h.
|
private |
! dedicated thread for all send operations
Definition at line 34 of file THttpWSEngine.h.
! if condition wait is called
Definition at line 39 of file THttpWSEngine.h.
enum { ... } THttpWSEngine::kNone |
! kind of operation