TCPSocket.connect(Object options)
小程序插件:不支持
相关文档: 网络使用说明
功能描述
在给定的套接字上启动连接
参数
Object options
属性 | 类型 | 默认值 | 必填 | 说明 |
address | string | | 是 | 套接字要连接的地址 |
port | number | | 是 | 套接字要连接的端口 |
timeout | number | 2 | 否 | 套接字要连接的超时时间,默认为 2s |
示例代码
The translations are provided by WeChat Translation and are for reference only. In case of any inconsistency and discrepancy between the Chinese version and the English version, the Chinese version shall prevail.Incorrect translation. Tap to report.