This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
component:internet:zh [2023/11/05 10:46] hfsr |
component:internet:zh [2023/11/05 10:47] hfsr [TCP Socket Object] |
||
---|---|---|---|
Line 8: | Line 8: | ||
- `isTcpEnabled():boolean` | - `isTcpEnabled():boolean` | ||
- | Returns whether TCP connections can be made (config setting). | + | 返回是否可建立TCP连接(可在配置文件中设置)。 |
- `isHttpEnabled():boolean` | - `isHttpEnabled():boolean` | ||
- | Returns whether HTTP requests can be made (config setting). | + | 返回是否可进行HTTP请求(可在配置文件中设置)。 |
- `connect(address:string[, port:number]):userdata` | - `connect(address:string[, port:number]):userdata` | ||
- | Opens a new TCP connection. Returns the handle of the connection. | + | 建立一个新的TCP连接。返回连接的句柄。 |
- `request(url:string[, postData:string[, headers:table]]):userdata` | - `request(url:string[, postData:string[, headers:table]]):userdata` | ||
- | Sends a new HTTP request. Returns the handle of the connection. | + | 发送一个新的HTTP请求。返回连接的句柄。 |
- | ==== TCP Socket Object ==== | + | ====TCP套接字对象==== |
- `read([n:number]):string` | - `read([n:number]):string` |