unsi 通用网络服务器接口类
更多...
unsi 通用网络服务器接口类
在文件 BuiltinObjects.x 第 680 行定义.
◆ Unsi() [1/2]
◆ Unsi() [2/2]
◆ addToNamelist() [1/2]
bool addToNamelist |
( |
String |
hostip, |
|
|
bool |
remove |
|
) |
| |
|
package |
◆ addToNamelist() [2/2]
bool addToNamelist |
( |
String |
, |
|
|
bool |
|
|
) |
| |
◆ clone() [1/2]
long clone |
( |
long |
context | ) |
|
|
package |
◆ clone() [2/2]
◆ config() [1/2]
bool config |
( |
int |
numOfThreads, |
|
|
int |
bufferSize, |
|
|
int |
timeout |
|
) |
| |
|
package |
配置服务器参数
- 参数
-
numOfThreads | 线程数量 默认为cpu core x 2 |
bufferSize | 缓冲区大小 |
timeout | 超时限定 时间内没有数据交互的链接将被强行关闭 |
- 返回
- 成功/失败
◆ config() [2/2]
bool config |
( |
int |
, |
|
|
int |
, |
|
|
int |
|
|
) |
| |
◆ create() [1/2]
bool create |
( |
AsyncInput |
input, |
|
|
int |
mode, |
|
|
int |
port, |
|
|
int |
timeout |
|
) |
| |
|
package |
创建服务器服务器参数
- 参数
-
input异步输入 | |
mode | 模式 TCP|UDP CAUNSI_TCP 1 CAUNSI_UDP 2 |
port | 服务端口 < 65535 |
timeout | 超时限定 时间内没有数据交互的链接将被强行关闭 |
- 返回
- 成功/失败
◆ create() [2/2]
◆ disconnect() [1/2]
bool disconnect |
( |
long |
context | ) |
|
|
package |
◆ disconnect() [2/2]
◆ equalsHandle() [1/2]
bool equalsHandle |
( |
long |
context | ) |
|
|
package |
比较实例句柄是否指向同一个链接
- 返回
- true, false
◆ equalsHandle() [2/2]
bool equalsHandle |
( |
long |
, |
|
|
long |
|
|
) |
| |
◆ finalize()
◆ getAsyncDirectOutput() [1/2]
◆ getAsyncDirectOutput() [2/2]
◆ getConnectionNumber() [1/2]
long getConnectionNumber |
( |
| ) |
|
◆ getConnectionNumber() [2/2]
long getConnectionNumber |
( |
| ) |
|
|
package |
◆ getId() [1/2]
long getId |
( |
long |
context | ) |
|
|
package |
◆ getId() [2/2]
◆ getNamelistMode() [1/2]
◆ getNamelistMode() [2/2]
◆ getRemoteInetAddress() [1/2]
◆ getRemoteInetAddress() [2/2]
◆ send() [1/2]
bool send |
( |
long |
context, |
|
|
long |
id, |
|
|
byte [] |
buffer, |
|
|
int |
offset, |
|
|
int |
length |
|
) |
| |
|
package |
发送数据
- 参数
-
context | 链接句柄 |
id | 保留 , 应为0 |
buffer | 数据缓冲区 |
offset | 缓冲区偏移 |
length | 长度 |
- 返回
- 提交结果
◆ send() [2/2]
◆ setNamelistMode() [1/2]
void setNamelistMode |
( |
int |
mode | ) |
|
|
package |
设置服务器的名单模式
- 参数
-
mode | DISABLE_NAMELIST BLACK_NAMELIST WHITE_NAMELIST |
◆ setNamelistMode() [2/2]
void setNamelistMode |
( |
int |
| ) |
|
◆ start() [1/2]
◆ start() [2/2]
◆ BLACK_NAMELIST
static const int BLACK_NAMELIST = 0 |
|
staticpackage |
◆ DISABLE_NAMELIST
static const int DISABLE_NAMELIST = -1 |
|
staticpackage |
◆ UNSI_TCP
static const int UNSI_TCP = 1 |
|
staticpackage |
◆ UNSI_UDP
static const int UNSI_UDP = 2 |
|
staticpackage |
◆ WHITE_NAMELIST
static const int WHITE_NAMELIST = 1 |
|
staticpackage |