MCPcopy Create free account
hub / github.com/chronoxor/CppServer / HTTPCacheServer

Class HTTPCacheServer

examples/http_server.cpp:172–188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

170};
171
172class HTTPCacheServer : public CppServer::HTTP::HTTPServer
173{
174public:
175 using CppServer::HTTP::HTTPServer::HTTPServer;
176
177protected:
178 std::shared_ptr<CppServer::Asio::TCPSession> CreateSession(const std::shared_ptr<CppServer::Asio::TCPServer>& server) override
179 {
180 return std::make_shared<HTTPCacheSession>(std::dynamic_pointer_cast<CppServer::HTTP::HTTPServer>(server));
181 }
182
183protected:
184 void onError(int error, const std::string& category, const std::string& message) override
185 {
186 std::cout << "HTTP server caught an error with code " << error << " and category '" << category << "': " << message << std::endl;
187 }
188};
189
190int main(int argc, char** argv)
191{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected