12 #ifndef ROOT_THttpWSHandler
13 #define ROOT_THttpWSHandler
25 class THttpWSHandler :
public TNamed {
27 friend class THttpServer;
30 Bool_t fSyncMode{kTRUE};
31 Bool_t fDisabled{kFALSE};
34 std::vector<std::shared_ptr<THttpWSEngine>> fEngines;
36 std::shared_ptr<THttpWSEngine> FindEngine(UInt_t
id, Bool_t book_send = kFALSE);
38 Bool_t HandleWS(std::shared_ptr<THttpCallArg> &arg);
40 Int_t RunSendingThrd(std::shared_ptr<THttpWSEngine> engine);
42 Int_t PerformSend(std::shared_ptr<THttpWSEngine> engine);
44 void RemoveEngine(std::shared_ptr<THttpWSEngine> &engine, Bool_t terminate = kFALSE);
46 Int_t CompleteSend(std::shared_ptr<THttpWSEngine> &engine);
50 THttpWSHandler(
const char *name,
const char *title, Bool_t syncmode = kTRUE);
53 virtual void CompleteWSSend(UInt_t) {}
56 virtual Bool_t ProcessBatchHolder(std::shared_ptr<THttpCallArg> &) {
return kFALSE; }
60 virtual void VerifyDefaultPageContent(std::shared_ptr<THttpCallArg> &arg) { arg->AddNoCacheHeader(); }
63 virtual ~THttpWSHandler();
69 Bool_t IsSyncMode()
const {
return fSyncMode; }
76 virtual TString GetDefaultPageContent() {
return ""; }
79 virtual Bool_t CanServeFiles()
const {
return kFALSE; }
82 virtual Bool_t AllowMTProcess()
const {
return kFALSE; }
85 virtual Bool_t AllowMTSend()
const {
return kFALSE; }
88 Bool_t IsDisabled()
const {
return fDisabled; }
91 void SetDisabled() { fDisabled = kTRUE; }
94 Bool_t HasWS(UInt_t wsid) {
return !!FindEngine(wsid); }
99 UInt_t GetWS(Int_t num = 0);
101 void CloseWS(UInt_t wsid);
103 Int_t SendWS(UInt_t wsid,
const void *buf,
int len);
105 Int_t SendHeaderWS(UInt_t wsid,
const char *hdr,
const void *buf,
int len);
107 Int_t SendCharStarWS(UInt_t wsid,
const char *str);
109 virtual Bool_t ProcessWS(THttpCallArg *arg) = 0;
111 ClassDef(THttpWSHandler, 0)