fastdo
0.6.16
首页
命名空间
类
文件
文件列表
文件成员
webx_HttpApp.hpp
浏览该文件的文档.
1
#pragma once
2
3
namespace
eienwebx
4
{
6
struct
HttpAppPrivateData
7
{
8
winux::String
exeFile
;
9
winux::String
exeDirPath
;
10
winux::String
exeTitle
;
11
};
12
13
class
HttpRequestCtx
;
14
18
class
EIENWEBX_DLL
HttpApp
:
public
App
,
public
http::HttpServer
19
{
20
public
:
21
static
HttpAppPrivateData
PrivateData
;
22
24
static
void
InitPrivateData();
25
33
using
CrossRouteHandlerFunction
=
http::CrossRouteHandlerFunctionT<HttpRequestCtx, Response>
;
34
39
using
RouteHandlerFunction
=
http::RouteHandlerFunctionT<HttpRequestCtx, Response>
;
40
42
HttpApp
();
43
48
HttpApp
(
winux::ConfigureSettings
const
& settings,
AppServerExternalData
* externalData );
49
61
HttpApp
(
62
winux::ConfigureSettings
const
& settings,
63
AppServerExternalData
* externalData,
64
eiennet::ip::EndPoint
const
& ep,
65
int
threadCount = 4,
66
int
backlog = 0,
67
double
serverWait = 0.002,
68
double
verboseInterval = 0.01,
69
eiennet::VerboseOutputType
verbose =
eiennet::votConsole
,
70
int
cacheLifeTime = 86400
71
);
72
80
bool
init(
winux::ConfigureSettings
const
& settings,
AppServerExternalData
* externalData );
81
96
bool
init(
97
winux::ConfigureSettings
const
& settings,
98
AppServerExternalData
* externalData,
99
eiennet::ip::EndPoint
const
& ep,
100
int
threadCount = 4,
101
int
backlog = 0,
102
double
serverWait = 0.002,
103
double
verboseInterval = 0.01,
104
eiennet::VerboseOutputType
verbose =
eiennet::votConsole
,
105
int
cacheLifeTime = 86400
106
);
107
113
void
crossRoute(
winux::String
const
& method,
winux::String
const
& path,
CrossRouteHandlerFunction
handler );
114
120
void
route(
winux::String
const
& method,
winux::String
const
& path,
RouteHandlerFunction
handler );
121
125
virtual
int
run(
void
* runParam )
override
;
126
127
protected
:
128
virtual
eiennet::ClientCtx
* onCreateClient(
winux::uint64
clientId,
winux::String
const
& clientEpStr,
winux::SharedPointer<eiennet::ip::tcp::Socket>
clientSockPtr )
override
;
129
virtual
http::Response
* onCreateResponse(
http::Request
& req,
winux::SimplePointer<http::RspOutputMgr>
outputMgr )
override
;
130
virtual
bool
_beginHttpRequest(
winux::SharedPointer<http::HttpRequestCtx>
requestCtxPtr,
http::UrlPathPartData
* urlData )
override
;
131
virtual
bool
onExtensionHandling(
winux::String
const
& extName,
winux::String
const
& fullPath,
winux::SharedPointer<http::Request>
requestPtr,
http::Response
& rsp )
override
;
132
133
friend
class
HttpRequestCtx
;
134
};
135
136
}
// namespace eienwebx
http::CrossRouteHandlerFunctionT
std::function< bool(winux::SharedPointer< _ReqClass > requestPtr, _RspClass &rsp, winux::StringArray const &urlPathPartArr, size_t i) > CrossRouteHandlerFunctionT
过径路由处理函数类型
Definition:
http_UrlRouter.hpp:15
eiennet::ip::EndPoint
IP端点对象
Definition:
eiennet_socket.hpp:751
eiennet::ClientCtx
基础客户场景类
Definition:
eiennet_socket.hpp:1055
http::UrlPathPartData
处理URL路径部分时的一些中间变量
Definition:
http_misc.hpp:12
eienwebx::HttpRequestCtx
HTTP客户请求场景
Definition:
webx_HttpRequestCtx.hpp:8
EIENWEBX_DLL
#define EIENWEBX_DLL
Definition:
eienwebx_base.hpp:27
eienwebx::HttpApp
HTTP服务器应用
Definition:
webx_HttpApp.hpp:18
winux::String
XString< tchar > String
Definition:
utilities.hpp:261
eienwebx
Web功能的相关封装
Definition:
eienwebx_base.hpp:45
winux::ConfigureSettings
更强大的配置文件类
Definition:
archives.hpp:71
http::RouteHandlerFunctionT
std::function< void(winux::SharedPointer< _ReqClass > requestPtr, _RspClass &rsp) > RouteHandlerFunctionT
普通路由处理函数类型
Definition:
http_UrlRouter.hpp:22
eiennet::votConsole
在控制台输出
Definition:
eiennet_socket.hpp:1050
http::HttpServer::RouteHandlerFunction
RouteHandlerFunctionT< HttpRequestCtx, Response > RouteHandlerFunction
普通路由处理函数类型
Definition:
http_HttpServer.hpp:24
http::HttpServer
HTTP服务器
Definition:
http_HttpServer.hpp:6
http::Request
HTTP请求
Definition:
http_Request.hpp:8
eienwebx::App
App类,内部有Do文件载入/执行功能
Definition:
webx_App.hpp:13
winux::SharedPointer
引用计数共享指针
Definition:
smartptr.hpp:456
eienwebx::HttpAppPrivateData::exeFile
winux::String exeFile
可执行文件(目录+文件名)
Definition:
webx_HttpApp.hpp:8
eienwebx::HttpAppPrivateData::exeTitle
winux::String exeTitle
可执行文件名标题(不带扩展名)
Definition:
webx_HttpApp.hpp:10
eienwebx::HttpAppPrivateData
HttpApp私有数据
Definition:
webx_HttpApp.hpp:6
eiennet::VerboseOutputType
VerboseOutputType
冗余信息输出类型
Definition:
eiennet_socket.hpp:1047
eienwebx::HttpApp::PrivateData
static HttpAppPrivateData PrivateData
Definition:
webx_HttpApp.hpp:21
http::Response
HTTP响应
Definition:
http_Response.hpp:8
winux::SimplePointer< http::RspOutputMgr >
http::HttpServer::CrossRouteHandlerFunction
CrossRouteHandlerFunctionT< HttpRequestCtx, Response > CrossRouteHandlerFunction
过径路由处理函数类型
Definition:
http_HttpServer.hpp:18
winux::uint64
unsigned __int64 uint64
Definition:
utilities.hpp:230
AppServerExternalData
App服务器外部定义的公开数据
Definition:
appserv.hpp:7
eienwebx::HttpAppPrivateData::exeDirPath
winux::String exeDirPath
可执行文件目录路径
Definition:
webx_HttpApp.hpp:9
dist
x64
include
webx_HttpApp.hpp
生成于 2024年 十二月 24日 星期二 01:35:07 , 为 fastdo使用
1.8.11