xlang v4.0 Release
程序设计语言基础库文档
载入中...
搜索中...
未找到
Unsi.xcs
浏览该文件的文档.
1
5@Declare
6class Unsi{
10 static const int UNSI_TCP = 1;
11
15 static const int UNSI_UDP = 2;
16
20 static const int DISABLE_NAMELIST = -1;
21
25 static const int BLACK_NAMELIST = 0;
26
30 static const int WHITE_NAMELIST = 1;
31
32
38
39
43 bool start();
44
45
50 bool disconnect(long context);
51
59 bool config(int numOfThreads, int bufferSize, int timeout);
60
71 bool create(AsyncInput input, int mode,int port, int timeout);
72
78
88 bool send(long context, long id, byte[] buffer, int offset, int length);
89
90
96
101 long clone(long context);
102
107 long getId(long context);
108
113 bool equalsHandle(long context);
114
115
122
127 void setNamelistMode(int mode);
128
129
134
140 bool addToNamelist(String hostip, bool remove);
141};
网络地址类
字符串类
unsi 通用网络服务器接口类
int getNamelistMode()
获取服务器的名单模式
InetAddress getRemoteInetAddress(long context)
获取远程地址信息
static const int WHITE_NAMELIST
开启白名单模式
void setNamelistMode(int mode)
设置服务器的名单模式
Unsi(AsyncInput input)
构造函数
bool addToNamelist(String hostip, bool remove)
将ip添加到\删除名单中
static const int UNSI_UDP
UDP模式
bool disconnect(long context)
断开连接
long getId(long context)
获取实例ID
long clone(long context)
克隆实例句柄
long getConnectionNumber()
获取当前的连接数
bool send(long context, long id, byte[] buffer, int offset, int length)
发送数据
static const int BLACK_NAMELIST
开启黑名单模式
bool start()
启动服务器
static const int UNSI_TCP
TCP模式
bool create(AsyncInput input, int mode,int port, int timeout)
创建服务器服务器参数
bool equalsHandle(long context)
比较实例句柄是否指向同一个链接
AsyncOutput getAsyncDirectOutput()
获取异步输出接口
static const int DISABLE_NAMELIST
禁用名单模式
bool config(int numOfThreads, int bufferSize, int timeout)
配置服务器参数
异步输入接口 需要继承
Definition AsyncInput.xcs:6
异步输出接口 需要继承