socket.from() function
socket.from() 函数
socket.from()
returns data from a socket connection and outputs a stream of tables given a specified decoder.
socket.from()
函数从套接字连接返回数据,并根据指定的解码器输出表格流。
The function produces a single table for everything that it receives from the start to the end of the connection.
该函数为从连接开始到结束接收的所有内容生成单个表格。
Function type signature
函数类型签名
(url: string, ?decoder: string) => stream[A]
For more information, see Function type signatures.
有关更多信息,请参阅 函数类型签名。
Parameters
参数
url
(Required) URL to return data from.
(Required) 必需) 要从中返回数据的 URL。
Supported URL schemes
支持的 URL 方案:
- tcp
- unix
decoder
Decoder to use to parse returned data into a stream of tables.
用于将返回的数据解析为表格流的解码器。
Supported decoders
支持的解码器:
- csv
- line
Examples
示例
- Query annotated CSV from a socket connection
从套接字连接查询带注释的 CSV
- Query line protocol from a socket connection
从套接字连接查询行协议
Query annotated CSV from a socket connection
从套接字连接查询带注释的 CSV
import "socket"
socket.from(url: "tcp://127.0.0.1:1234", decoder: "csv")
Query line protocol from a socket connection
从套接字连接查询行协议
import "socket"
socket.from(url: "tcp://127.0.0.1:1234", decoder: "line")
Was this page helpful?
此页面是否对您有帮助?
Thank you for your feedback!
感谢您的反馈!
Support and feedback
支持和反馈
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for Flux and this documentation. To find support, use the following resources
感谢您成为我们社区的一份子!我们欢迎并鼓励您对 Flux 和本文档提供反馈和错误报告。要获得支持,请使用以下资源
- InfluxDB Discord Server (Preferred)
InfluxDB Discord 服务器 (Preferred)(首选)
- InfluxData Community
InfluxData 社区
- InfluxDB Community Slack
InfluxDB 社区 Slack
- InfluxDB Subreddit
InfluxDB Subreddit
Customers with an annual or support contract can contact InfluxData Support.
拥有年度或支持合同的客户 可以联系 InfluxData 支持。