MCPcopy Create free account
hub / github.com/catboost/catboost / THttpServer

Class THttpServer

library/cpp/http/server/http.h:17–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15class TClientConnection;
16
17class THttpServer {
18 friend class TClientRequest;
19 friend class TClientConnection;
20
21public:
22 class ICallBack {
23 public:
24 struct TFailLogData {
25 int failstate;
26 TString url;
27 };
28
29 virtual ~ICallBack() {
30 }
31
32 virtual void OnFailRequest(int /*failstate*/) {
33 }
34
35 virtual void OnFailRequestEx(const TFailLogData& d) {
36 OnFailRequest(d.failstate);
37 }
38
39 virtual void OnException() {
40 }
41
42 virtual void OnMaxConn() {
43 }
44
45 virtual TClientRequest* CreateClient() = 0;
46
47 virtual void OnListenStart() {
48 }
49
50 virtual void OnListenStop() {
51 }
52
53 virtual void OnWait() {
54 }
55
56 virtual void* CreateThreadSpecificResource() {
57 return nullptr;
58 }
59
60 virtual void DestroyThreadSpecificResource(void*) {
61 }
62 };
63
64 typedef THttpServerOptions TOptions;
65 typedef TSimpleSharedPtr<IThreadPool> TMtpQueueRef;
66
67 THttpServer(ICallBack* cb, const TOptions& options = TOptions(), IThreadFactory* pool = nullptr);
68 THttpServer(ICallBack* cb, TMtpQueueRef mainWorkers, TMtpQueueRef failWorkers, const TOptions& options = TOptions());
69 virtual ~THttpServer();
70
71 bool Start();
72
73 // shutdown a.s.a.p.
74 void Stop();

Callers

nothing calls this directly

Calls 1

TOptionsClass · 0.50

Tested by

no test coverage detected