TCP (Client)

The TCP (Client) output in ArcGIS Velocity sends events formatted as delimited text and JSON to a TCP server using a TCP socket connection. You can find this output listed under the Web and Messaging options.

Example

以下是输出的使用示例:

A weather monitoring system streams real-time temperature and humidity data from remote sensors. The data is sent in delimited text format through the TCP (Client) output to a cloud-based dashboard server for real-time visualization. Each sensor station connects using its own port to keep the data organized.

Usage notes

使用输出时,请谨记以下信息:

  • Velocity 支持多个输出数据格式。 这些格式包括 JSON、GeoJSON、EsriJSON 和分隔文本。
  • 当选择使用分隔文本格式时,必须指定要在属性值之间放置的分隔符。 常见分隔符包括逗号、管道字符或分号。
  • The Host parameter supports hostname or IP address, including elastic IP address commonly used in cloud environments.
  • It is recommended that different feeds of event data use their own TCP (Client) output configurations and ports.

Parameters

以下是输出的参数:

ParameterDescriptionData type
Host

(必填)

The host name or the IP address of the TCP server to establish a socket connection. The default is localhost. The host value can also be 1.1.1.1 or example.com.

字符串

Port

(必填)

The TCP port number on which the server is listening to incoming connections—for example, 5005.

整型

Connection Timeout

(可选)

Specifies how long, in seconds, the client waits while trying to establish a connection to the TCP server. If the connection cannot be established in the specified amount of time, the output reports an error. The default is 60 seconds.

整型

Output data format

(必填)

Specifies the data format type of your output. Options are GeoJSON, EsriJSON, Delimited, and JSON.

Output data format type

Considerations and limitations

使用输出时应考虑以下问题:

  • If you provide invalid information for the Host or Port parameter, Velocity throws an error because it cannot establish connection to the specified host name and port.
  • A TCP connection may be abruptly terminated by the TCP server when, for example, server resources have been depleted, or the server thinks that the client is no longer reachable because it has not responded to a control message. Once the client-server connection is closed, neither entity can communicate status with the other. This means an active TCP (Client) output may not be able to automatically reconnect. It is recommended that you manually stop and restart the Velocity output to restore connection to the TCP server in this case.