udp协议套接字
更多...
udp协议套接字
在文件 DgramSocket.xcs 第 6 行定义.
◆ DgramSocket()
◆ available()
long available |
( |
bool |
wait | ) |
|
|
package |
◆ bind()
bool bind |
( |
String |
host, |
|
|
int |
port |
|
) |
| |
|
package |
◆ close()
◆ connect()
bool connect |
( |
String |
host, |
|
|
int |
port |
|
) |
| |
|
package |
◆ getHandle()
◆ getLocalAddress()
◆ getLocalInetAddress()
◆ getLocalPort()
◆ getRemoteAddress()
◆ getRemoteInetAddress()
◆ getRemotePort()
◆ getSelectFlags()
◆ read()
int read |
( |
byte [] |
buffer, |
|
|
int |
pos, |
|
|
int |
length |
|
) |
| |
|
package |
◆ recvPacket() [1/2]
DgramPacket recvPacket |
( |
| ) |
|
|
package |
◆ recvPacket() [2/2]
bool recvPacket |
( |
DgramPacket |
packet | ) |
|
|
package |
◆ select()
int select |
( |
DgramSocket [] |
sockets, |
|
|
int |
offset, |
|
|
int |
count, |
|
|
int [] |
sets, |
|
|
int |
timeout |
|
) |
| |
|
package |
选择事件触发的socket
- 参数
-
offset | 偏移量 |
count | 选择的总数量 |
sets | 数组 用于接收结果 |
time | 超时 |
- 返回
- 结果
◆ sendTo()
int sendTo |
( |
String |
host, |
|
|
int |
port, |
|
|
byte [] |
buffer, |
|
|
int |
pos, |
|
|
int |
length |
|
) |
| |
|
package |
发送数据到指定地址
- 参数
-
host | 目标地址 |
port | 目标端口 |
buffer | 缓冲区 |
pos | 位置 |
length | 长度 |
- 返回
- 写入的长度
◆ setSelectFlags()
void setSelectFlags |
( |
int |
flags | ) |
|
|
package |
◆ write()
int write |
( |
byte [] |
buffer, |
|
|
int |
pos, |
|
|
int |
length |
|
) |
| |
|
package |