2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
20#ifndef WEB_HTTP_SERVER_SOCKETCONTEXTUPGRADEFACTORYSELECTOR_H
21#define WEB_HTTP_SERVER_SOCKETCONTEXTUPGRADEFACTORYSELECTOR_H
23#include "web/http/SocketContextUpgradeFactorySelector.h"
24#include "web/http/server/SocketContextUpgradeFactory.h"
28#ifndef DOXYGEN_SHOULD_SKIP_THIS
32namespace web::http::server {
34 class SocketContextUpgradeFactorySelector
35 :
public web::http::SocketContextUpgradeFactorySelector<web::http::server::SocketContextUpgradeFactory> {
37 using Super = web::http::SocketContextUpgradeFactorySelector<web::http::server::SocketContextUpgradeFactory>;
40 SocketContextUpgradeFactory* load(
const std::string& socketContextUpgradeName)
override;
43 static SocketContextUpgradeFactorySelector* instance();
46 SocketContextUpgradeFactory* select(
Request& req,
Response& res) override;
51extern template class web::http::SocketContextUpgradeFactorySelector<web::http::server::SocketContextUpgradeFactory>;
void onSourceData(const char *chunk, std::size_t chunkLen) override
Response(SocketContext *socketContext)
SocketContext * getSocketContext() const
void onSourceConnect(core::pipe::Source *source) override
Response & status(int statusCode)
void send(const std::string &chunk)
void send(const char *chunk, std::size_t chunkLen)
Response & setTrailer(const std::string &field, const std::string &value, bool overwrite=true)
Response & set(const std::map< std::string, std::string > &headers, bool overwrite=true)
Response & set(const std::string &field, const std::string &value, bool overwrite=true)
void upgrade(const std::shared_ptr< Request > &request, const std::function< void(const std::string &)> &status)
Response & type(const std::string &type)
void onSourceError(int errnum) override
Response & sendFragment(const std::string &chunk)
Response & cookie(const std::string &name, const std::string &value, const std::map< std::string, std::string > &options={})
Response & append(const std::string &field, const std::string &value)
void sendStatus(int statusCode)
Response & sendFragment(const char *chunk, std::size_t chunkLen)
void onSourceEof() override
void sendFile(const std::string &file, const std::function< void(int)> &callback)
Response & clearCookie(const std::string &name, const std::map< std::string, std::string > &options={})
const std::string & header(const std::string &field)
#define to_hex_str(int_val)