fastdo
0.6.8
|
HTTP服务器 更多...
#include <eiennet_httpserv.hpp>
Public 类型 | |
using | ResponseHandlerFunction = std::function< void(eiennet::old_v1::HttpServer::ClientCtxSharedPointer &clientCtxPtr, http::Header const &reqHdr, http::Url const &url, http::Header &rspHdr, std::ostream &rspOut) > |
Public 类型 继承自 eiennet::old_v1::Server< HttpClientCtx > | |
using | ClientCtxSharedPointer = winux::SharedPointer< HttpClientCtx > |
using | StartupHandlerFunction = std::function< void(ClientCtxSharedPointer clientCtxPtr) > |
Public 成员函数 | |
HttpServer (HttpServerConfig const &confObj) | |
构造函数1,需要一个配置对象 更多... | |
HttpServer (winux::String const &serverIp, winux::ushort port, int threadCount=4, int listenBacklog=10, double durationSec=0.1) | |
构造函数2 更多... | |
void | setHandler (winux::String const &urlPath, ResponseHandlerFunction handler) |
设置动态页面处理 更多... | |
Public 成员函数 继承自 eiennet::old_v1::Server< HttpClientCtx > | |
Server (ip::EndPoint const &ep, int threadCount=4, int backlog=0) | |
构造函数1 更多... | |
virtual | ~Server () |
virtual int | run () |
void | stop (bool b=true) |
是否停止服务运行 更多... | |
size_t | getClientsCount () const |
void | onStartupHandler (StartupHandlerFunction handler) |
void | removeClient (winux::uint64 clientId) |
Public 属性 | |
HttpServerConfig | config |
配置参数 更多... | |
Protected 成员函数 | |
virtual void | onStartup (ClientCtxSharedPointer clientCtxPtr) override |
void | _doRecvRequestHeaderTask (ClientCtxSharedPointer clientCtxPtr) |
void | _doRecvRequestBodyTask (ClientCtxSharedPointer clientCtxPtr) |
void | _doRequestTask (ClientCtxSharedPointer clientCtxPtr) |
void | _webProcess (ClientCtxSharedPointer &clientCtxPtr, http::Header const &reqHdr, http::Url const &url, http::Header &rspHdr, std::ostream &rspOut) |
Protected 成员函数 继承自 eiennet::old_v1::Server< HttpClientCtx > | |
ClientCtxSharedPointer & | _addClient (ip::EndPoint const &clientEp, winux::SharedPointer< ip::tcp::Socket > clientSockPtr) |
友元 | |
class | HttpClientCtx |
额外继承的成员函数 | |
Protected 属性 继承自 eiennet::old_v1::Server< HttpClientCtx > | |
winux::uint64 | _cumulativeClientId |
bool | _stop |
winux::ThreadPool | _pool |
winux::Mutex | _mtxServer |
ip::tcp::Socket | _servSock |
std::map< winux::uint64, ClientCtxSharedPointer > | _clients |
StartupHandlerFunction | _startupHandler |
HTTP服务器
在文件 eiennet_httpserv.hpp 第 212 行定义.
using eiennet::old_v1::HttpServer::ResponseHandlerFunction = std::function< void ( eiennet::old_v1::HttpServer::ClientCtxSharedPointer & clientCtxPtr, http::Header const & reqHdr, http::Url const & url, http::Header & rspHdr, std::ostream & rspOut ) > |
在文件 eiennet_httpserv.hpp 第 218 行定义.
eiennet::old_v1::HttpServer::HttpServer | ( | HttpServerConfig const & | confObj | ) |
构造函数1,需要一个配置对象
eiennet::old_v1::HttpServer::HttpServer | ( | winux::String const & | serverIp, |
winux::ushort | port, | ||
int | threadCount = 4 , |
||
int | listenBacklog = 10 , |
||
double | durationSec = 0.1 |
||
) |
构造函数2
|
protected |
|
protected |
|
protected |
|
protected |
|
overrideprotectedvirtual |
|
inline |
设置动态页面处理
在文件 eiennet_httpserv.hpp 第 225 行定义.
|
friend |
在文件 eiennet_httpserv.hpp 第 247 行定义.
HttpServerConfig eiennet::old_v1::HttpServer::config |
配置参数
在文件 eiennet_httpserv.hpp 第 215 行定义.