Difference between revisions of "MC-Basic:ACCEPT/zh-hans"
(Created page with "{{Languages}} {{MC-Basic |缩写= |格式= Accept({#<''listening device number''>}, #<''accepting device number''>, <''port number''>) |使用版本= |描述= 将TCP 套...") |
|||
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | {{Languages}} | + | {{Languages|MC-Basic:ACCEPT}} |
− | |||
− | |||
+ | == 缩写 == | ||
− | + | ||
+ | == 格式 == | ||
Accept({#<''listening device number''>}, #<''accepting device number''>, <''port number''>) | Accept({#<''listening device number''>}, #<''accepting device number''>, <''port number''>) | ||
− | + | == 可用版本 == | |
− | + | == 描述 == | |
将TCP 套接字 绑定到特定端口并接受该端口连接,监听TCP 套接字. <''port number''>定义TCP端口。 | 将TCP 套接字 绑定到特定端口并接受该端口连接,监听TCP 套接字. <''port number''>定义TCP端口。 | ||
− | + | ||
− | + | == 类型 == | |
<''listening device number''>: Long | <''listening device number''>: Long | ||
Line 23: | Line 23: | ||
− | + | == 取值范围 == | |
<''listening device number''>: 1 to 255 | <''listening device number''>: 1 to 255 | ||
Line 30: | Line 30: | ||
<''port number''>: 6000 through 6999 | <''port number''>: 6000 through 6999 | ||
− | + | == 单位 == | |
− | |||
− | |||
+ | == 默认 == | ||
− | + | == 使用范围 == | |
Task | Task | ||
− | + | == 限制 == | |
Task only | Task only | ||
Line 47: | Line 46: | ||
*无法连接 | *无法连接 | ||
− | + | == 例子 == | |
+ | |||
'''例子''' | '''例子''' | ||
Line 73: | Line 73: | ||
* 接收设备[x]在接收数据时不能关闭应用程序。 | * 接收设备[x]在接收数据时不能关闭应用程序。 | ||
− | + | == 参见 == | |
* [[MC-Basic:CLOSE|CLOSE]] | * [[MC-Basic:CLOSE|CLOSE]] | ||
* [[MC-Basic:CONNECT|CONNECT]] | * [[MC-Basic:CONNECT|CONNECT]] | ||
Line 81: | Line 81: | ||
<!-- [[Category:MC-Basic:Communication|ACCEPT]] --> | <!-- [[Category:MC-Basic:Communication|ACCEPT]] --> | ||
− |
Latest revision as of 16:30, 17 April 2017
语言: | English • 中文(简体) |
---|
缩写
格式
Accept({#<listening device number>}, #<accepting device number>, <port number>)
可用版本
描述
将TCP 套接字 绑定到特定端口并接受该端口连接,监听TCP 套接字. <port number>定义TCP端口。
类型
<listening device number>: Long
<accepting device number>: Long
<port number>: Long
取值范围
<listening device number>: 1 to 255
<accepting device number>: 1 to 255
<port number>: 6000 through 6999
单位
默认
使用范围
Task
限制
Task only
错误:
- 套接字不可用
- 无法连接
例子
例子
Accept(#1,65456)
例子 - 从版本4.0.14起:
Dim X as long = 2
OpenSocket Options=1 as #1 ‘明确打开套接字的监听端口
while TRUE
OpenSocket Options=1 as #X ‘明确打开套接字接受新的连接的监听端口
Accept(#1, #X, 6002)
X=X+1
End while
在种情况下:
- 监听设备是固定的,并且已经绑定到端口上。只有当监听结束时才能被关闭。
- 接受设备[x]每次创建一个侦听器创建新的服务任务。
- 接收设备[x]在接收数据时不能关闭应用程序。
参见