fastdo  0.5.12
eiennet::HttpServer类 参考

http服务器 更多...

#include <eiennet_httpserv.hpp>

类 eiennet::HttpServer 继承关系图:
eiennet::HttpServer 的协作图:

Public 类型

using ResponseHandlerFunction = std::function< void(eiennet::HttpServer::ClientCtxSharedPointer &clientCtxPtr, http::Header const &reqHdr, http::Url const &url, http::Header &rspHdr, std::ostream &rspOut) >
 
- Public 类型 继承自 eiennet::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::Server< HttpClientCtx >
 Server (ip::EndPoint const &ep, int threadCount=4, int backlog=0, double durationSec=0.1)
 构造函数1 更多...
 
virtual ~Server ()
 
virtual int run ()
 
size_t getClientsCount () const
 
void onStartupHandler (StartupHandlerFunction handler)
 
void removeClient (winux::uint64 clientId)
 

Public 属性

HttpServerConfig const config
 配置参数 更多...
 

友元

class HttpClientCtx
 

额外继承的成员函数

- Protected 成员函数 继承自 eiennet::Server< HttpClientCtx >
ClientCtxSharedPointer_addClient (ip::EndPoint const &clientEp, winux::SharedPointer< ip::tcp::Socket > clientSockPtr)
 
- Protected 属性 继承自 eiennet::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.hpp55 行定义.

成员类型定义说明

using eiennet::HttpServer::ResponseHandlerFunction = std::function< void ( eiennet::HttpServer::ClientCtxSharedPointer & clientCtxPtr, http::Header const & reqHdr, http::Url const & url, http::Header & rspHdr, std::ostream & rspOut ) >

在文件 eiennet_httpserv.hpp61 行定义.

构造及析构函数说明

eiennet::HttpServer::HttpServer ( HttpServerConfig const &  confObj)

构造函数1,需要一个配置对象

eiennet::HttpServer::HttpServer ( winux::String const &  serverIp,
winux::ushort  port,
int  threadCount = 4,
int  listenBacklog = 10,
double  durationSec = 0.1 
)

构造函数2

成员函数说明

void eiennet::HttpServer::setHandler ( winux::String const &  urlPath,
ResponseHandlerFunction  handler 
)
inline

在文件 eiennet_httpserv.hpp68 行定义.

友元及相关函数文档

friend class HttpClientCtx
friend

在文件 eiennet_httpserv.hpp88 行定义.

类成员变量说明

HttpServerConfig const eiennet::HttpServer::config

配置参数

在文件 eiennet_httpserv.hpp58 行定义.


该类的文档由以下文件生成: