|
using | CrossRouteHandlerFunction = CrossRouteHandlerFunctionT< HttpRequestCtx, Response > |
| 过径路由处理函数类型 更多...
|
|
using | RouteHandlerFunction = RouteHandlerFunctionT< HttpRequestCtx, Response > |
| 普通路由处理函数类型 更多...
|
|
using | CreateResponseHandlerFunction = std::function< Response *(Request &req, winux::SimplePointer< RspOutputMgr > outputMgr) > |
| 创建响应处理函数类型 更多...
|
|
using | ClientDataNotifyHandlerFunction = std::function< void(winux::SharedPointer< ClientCtx > clientCtxPtr, size_t readableSize) > |
| 客户数据通知,当Server::_isAutoReadData 为false时有效 更多...
|
|
using | ClientDataArrivedHandlerFunction = std::function< void(winux::SharedPointer< ClientCtx > clientCtxPtr, winux::Buffer &data) > |
| 客户数据到达,当Server::_isAutoReadData 为true时有效 更多...
|
|
using | CreateClientHandlerFunction = std::function< ClientCtx *(winux::uint64 clientId, winux::String const &clientEpStr, winux::SharedPointer< ip::tcp::Socket > clientSockPtr) > |
| 创建客户连接对象 更多...
|
|
using | CrossRouteHandlerFunction = CrossRouteHandlerFunctionT< http::Request, http::Response > |
|
using | RouteHandlerFunction = RouteHandlerFunctionT< http::Request, http::Response > |
|
using | WebMainHandlerFunction = std::function< void(winux::SharedPointer< http::Request > requestPtr, http::Response &rsp) > |
| WebMain逻辑处理函数类型 更多...
|
|
using | ExtensionHandlingHandlerFunction = std::function< bool(winux::String const &extName, winux::String const &fullPath, winux::SharedPointer< http::Request > requestPtr, http::Response &rsp) > |
| 特别扩展名处理函数类型 更多...
|
|
|
| HttpServer () |
| 构造函数0 更多...
|
|
| HttpServer (winux::ConfigureSettings const &settings) |
| 构造函数1 更多...
|
|
| HttpServer (winux::ConfigureSettings const &settings, eiennet::ip::EndPoint const &ep, int threadCount=4, int backlog=0, double serverWait=0.002, double verboseInterval=0.01, eiennet::VerboseOutputType verbose=eiennet::votConsole, int cacheLifeTime=86400) |
| 构造函数2 更多...
|
|
bool | init (winux::ConfigureSettings const &settings) |
| 初始化1 更多...
|
|
bool | init (winux::ConfigureSettings const &settings, eiennet::ip::EndPoint const &ep, int threadCount=4, int backlog=0, double serverWait=0.002, double verboseInterval=0.01, eiennet::VerboseOutputType verbose=eiennet::votConsole, int cacheLifeTime=86400) |
| 初始化2 更多...
|
|
void | crossRoute (winux::String const &method, winux::String const &path, CrossRouteHandlerFunction handler) |
| 注册过径路由处理器 更多...
|
|
void | route (winux::String const &method, winux::String const &path, RouteHandlerFunction handler) |
| 注册普通路由处理器 更多...
|
|
virtual int | run (void *runParam) override |
| 运行 更多...
|
|
void | onCreateResponseHandler (CreateResponseHandlerFunction handler) |
|
| Server () |
| 构造函数0,不会启动服务,必须手动调用startup() 更多...
|
|
| Server (bool autoReadData, ip::EndPoint const &ep, int threadCount=4, int backlog=0, double serverWait=0.002, double verboseInterval=0.01, VerboseOutputType verbose=votConsole) |
| 构造函数1,会启动服务 更多...
|
|
virtual | ~Server () |
|
bool | startup (bool autoReadData, ip::EndPoint const &ep, int threadCount=4, int backlog=0, double serverWait=0.002, double verboseInterval=0.01, VerboseOutputType verbose=votConsole) |
| 启动服务器 更多...
|
|
void | stop (bool b=true) |
| 是否停止服务运行 更多...
|
|
size_t | getClientsCount () const |
| 获取客户连接数 更多...
|
|
void | removeClient (winux::uint64 clientId) |
| 移除客户连接 更多...
|
|
void | onClientDataNotifyHandler (ClientDataNotifyHandlerFunction handler) |
|
void | onClientDataArrivedHandler (ClientDataArrivedHandlerFunction handler) |
|
void | onCreateClientHandler (CreateClientHandlerFunction handler) |
|
| UrlRouter (http::HttpServerConfig *httpConfig=nullptr) |
| 构造函数 更多...
|
|
virtual | ~UrlRouter () |
| 析构函数 更多...
|
|
bool | init (http::HttpServerConfig *httpConfig) |
| 初始化 更多...
|
|
void | crossRoute (winux::String const &method, winux::String const &path, CrossRouteHandlerFunction handler) |
| 注册过径路由处理器 更多...
|
|
void | route (winux::String const &method, winux::String const &path, RouteHandlerFunction handler) |
| 注册普通路由处理器 更多...
|
|
void | onWebMainHandler (WebMainHandlerFunction handler) |
|
void | onExtensionHandlingHandler (ExtensionHandlingHandlerFunction handler) |
|
|
virtual eiennet::ClientCtx * | onCreateClient (winux::uint64 clientId, winux::String const &clientEpStr, winux::SharedPointer< eiennet::ip::tcp::Socket > clientSockPtr) override |
|
virtual void | onClientDataArrived (winux::SharedPointer< eiennet::ClientCtx > clientCtxPtr, winux::Buffer &data) override |
|
void | _onHttpRequestInternal (winux::SharedPointer< HttpRequestCtx > requestCtxPtr) |
| 处理一次HTTP请求 更多...
|
|
virtual bool | _beginHttpRequest (winux::SharedPointer< http::HttpRequestCtx > requestCtxPtr, http::UrlPathPartData *urlData) |
| 开始HTTP请求处理,初始化一些数据 更多...
|
|
virtual void | _endHttpRequest (winux::SharedPointer< http::HttpRequestCtx > requestCtxPtr) |
| HTTP请求处理完,进行一些收尾 更多...
|
|
virtual bool | _beginRouting (winux::SharedPointer< http::HttpRequestCtx > requestCtxPtr, http::UrlPathPartData const &urlData, http::Response &rsp) |
| 开始路由。返回false表示不路由 更多...
|
|
virtual void | _endRouting (winux::SharedPointer< http::HttpRequestCtx > requestCtxPtr, http::UrlPathPartData const &urlData, http::Response &rsp) |
| 结束路由 更多...
|
|
virtual void | _whatNextTask (winux::SharedPointer< HttpRequestCtx > requestCtxPtr) |
| 下一次要做的任务 更多...
|
|
virtual void | _doTask (winux::SharedPointer< http::HttpRequestCtx > requestCtxPtr) |
| 执行客户任务 更多...
|
|
void | _doRecvRequestHeaderTask (winux::SharedPointer< HttpRequestCtx > requestCtxPtr) |
| 接收请求头任务 更多...
|
|
void | _doRecvRequestBodyTask (winux::SharedPointer< HttpRequestCtx > requestCtxPtr) |
| 接收请求体任务 更多...
|
|
virtual Response * | onCreateResponse (Request &req, winux::SimplePointer< RspOutputMgr > outputMgr) |
|
virtual bool | _canAddClient (ClientCtx *clientCtx) |
| 是否添加一个客户连接。返回true添加,返回false不添加 更多...
|
|
bool | _addClient (ip::EndPoint const &clientEp, winux::SharedPointer< ip::tcp::Socket > clientSockPtr, winux::SharedPointer< ClientCtx > **ppClientCtxPtr) |
| 添加一个客户连接,会触发调用onCreateClient() 创建客户场景对象,会调用_canAddClient() 判断是否添加到服务器客户列表 更多...
|
|
template<typename _Fx , typename... _ArgType> |
void | _postTask (winux::SharedPointer< ClientCtx > clientCtxPtr, _Fx fn, _ArgType &&...arg) |
| 往线程池投递任务 更多...
|
|
virtual void | onClientDataNotify (winux::SharedPointer< ClientCtx > clientCtxPtr, size_t readableSize) |
|
virtual void | routing (winux::SharedPointer< http::Request > requestPtr, http::UrlPathPartData const &urlData, http::Response &rsp) |
| 路由处理 更多...
|
|
virtual void | onWebMain (winux::SharedPointer< http::Request > requestPtr, http::Response &rsp) |
|
virtual bool | onExtensionHandling (winux::String const &extName, winux::String const &fullPath, winux::SharedPointer< http::Request > requestPtr, http::Response &rsp) |
|
HTTP服务器
在文件 http_HttpServer.hpp 第 6 行定义.