86 return (*iter)->GetId();
95 if (eng->GetId() == wsid)
107 if (iter->get() == engine) {
127 if (arg->IsMethod(
"WS_CONNECT"))
132 if (arg->IsMethod(
"WS_READY")) {
135 Error(
"HandleWS",
"WS engine with similar id exists %u", arg->GetWSId());
139 auto handle = arg->TakeWSEngine();
140 engine = handle.get();
141 fEngines.push_back(std::move(handle));
152 if (arg->IsMethod(
"WS_CLOSE")) {
193 engine->
Send(buf, len);
void SendWS(UInt_t wsid, const void *buf, int len)
Send binary data via given websocket id.
Bool_t HandleWS(std::shared_ptr< THttpCallArg > &arg)
Process request to websocket Different kind of requests coded into THttpCallArg::Method "WS_CONNECT" ...
virtual ~THttpWSHandler()
destructor Delete all websockets handles
virtual void Send(const void *buf, int len)=0
THttpWSEngine * FindEngine(UInt_t id) const
Find websocket connection handle with given id.
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
The TNamed class is the base class for all named ROOT classes.
void CloseWS(UInt_t wsid)
Close connection with given websocket id.
void SendCharStarWS(UInt_t wsid, const char *str)
Send string via given websocket id.
void SendHeaderWS(UInt_t wsid, const char *hdr, const void *buf, int len)
Send binary data with binary data via given websocket id.
UInt_t GetWS(Int_t num=0) const
Return websocket id with given sequential number Number of websockets return with GetNumWS() method...
virtual void PostProcess(std::shared_ptr< THttpCallArg > &arg)
Method invoked after user process data received via websocket Normally request is no longer usable af...
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
std::vector< std::shared_ptr< THttpWSEngine > > fEngines
! list of active WS engines (connections)
void RemoveEngine(THttpWSEngine *engine)
Remove and destroy WS connection.
virtual Bool_t ProcessWS(THttpCallArg *arg)=0
virtual Bool_t PreviewData(std::shared_ptr< THttpCallArg > &arg)
Method should be invoked before processing data coming from websocket If method returns kTRUE...
virtual void ClearHandle()=0
THttpWSHandler(const char *name, const char *title)
THttpWSHandler.