xlang v4.0 Release
程序设计语言基础库文档
载入中...
搜索中...
未找到
Public 成员函数 | 包函数 | 静态包属性
HttpServer类 参考

HTTP 服务器 更多...

Public 成员函数

包函数

静态包属性

详细描述

HTTP 服务器

在文件 BuiltinObjects.x1331 行定义.

构造及析构函数说明

◆ HttpServer() [1/2]

void HttpServer ( )

◆ HttpServer() [2/2]

HttpServer ( )
package

构造

成员函数说明

◆ addWebsite() [1/2]

int addWebsite ( String  domains,
Website  website 
)
package

添加网站

参数
domains网站的域名列表, 用分号分割
website网站对象
返回
成功添加的域名数

◆ addWebsite() [2/2]

int addWebsite ( String  ,
  Website 
)

◆ close() [1/2]

void close ( )

◆ close() [2/2]

void close ( )
package

关闭服务器

◆ configHttps() [1/2]

bool configHttps ( bool  enable,
String  cert,
String  key 
)
package

设置启用https

参数
enable启用/禁用
cert证书
key密钥
返回
成功

◆ configHttps() [2/2]

bool configHttps ( bool  ,
  String,
  String 
)

◆ finalize() [1/2]

void finalize ( )

◆ finalize() [2/2]

void finalize ( )
package

清理工作 ,注意 继承对象并重写了finalize 必须使用super.finalize 以免内核对象泄露

◆ isRunning()

bool isRunning ( )

◆ quiesce() [1/2]

void quiesce ( )

◆ quiesce() [2/2]

void quiesce ( )
package

停止服务器接受新的链接, 但不影响已有链接

◆ setConnectionTimeout() [1/2]

bool setConnectionTimeout ( int  millisec)
package

限制链接的最大超时 小于等于0 为不限制

◆ setConnectionTimeout() [2/2]

bool setConnectionTimeout ( int  )

◆ setIpConnectionLimit() [1/2]

bool setIpConnectionLimit ( int  n)
package

限制单IP最大连接数为N 小于等于0 为不限制

◆ setIpConnectionLimit() [2/2]

bool setIpConnectionLimit ( int  )

◆ setMaxConnection() [1/2]

bool setMaxConnection ( int  n)
package

限制服务器的最大连接数为N 小于等于0 为不限制

◆ setMaxConnection() [2/2]

bool setMaxConnection ( int  )

◆ setThreadPoolSize() [1/2]

bool setThreadPoolSize ( int  n)
package

设置线程池的预备大小

◆ setThreadPoolSize() [2/2]

bool setThreadPoolSize ( int  )

◆ start()

bool start ( int  ,
int   
)

◆ startServer()

bool startServer ( int  flags,
int  port 
)
package

开启服务器

参数
flags服务器运行模式
参见
DEFAULT_MODEL
参数
port服务器端口
返回
成功

◆ stop()

bool stop ( )

结构体成员变量说明

◆ DEFAULT_MODEL

static const int DEFAULT_MODEL = 0
staticpackage

默认网络模型运行, 一般为EPOLL_MODEL

在文件 BuiltinObjects.x1332 行定义.

◆ EPOLL_MODEL

static const int EPOLL_MODEL = 3
staticpackage

以epoll网络模型运行

在文件 BuiltinObjects.x1335 行定义.

◆ POLL_MODEL

static const int POLL_MODEL = 2
staticpackage

以poll网络模型运行

在文件 BuiltinObjects.x1334 行定义.

◆ SELECT_MODEL

static const int SELECT_MODEL = 1
staticpackage

以select网络模型运行

在文件 BuiltinObjects.x1333 行定义.