TCP Server Connector
TCP Server Connector
TCP Server Connectors support hosting a generic endpoint for receiving arbitrary data over TCP.
Each TCP Server Connector listens on a specified port for incoming TCP traffic, either with SSL/TLS encryption or plaintext. The connector is intended for use when CData Arc needs to receive arbitrary data that does not necessarily fit into the constraints provided by other standard protocols.
Since TCP traffic is a constant stream that does not intrinsically have a ‘start’ or ‘end’ point, the connector must be configured to determine where one message ends and the next begins. The connector supports two approaches:
- A static string/character delimiter that ends the current message or begins the next message
- Reading a value in the incoming TCP data to determine how long the message should be
For the second approach, the connector requires an offset (how many bytes after the first byte to begin reading the message length) and a size (how many bytes to read, starting at the offset, to read the length value). If the length of the message is the first value in the ‘header’ for the message, the offset should be 0.
Once the delimiter or length is reached, the connector will push a message into the Arc Flow containing the raw data received over TCP.
The TCP Server Connector can also generate an Arc message when a client connects or disconnects, to alert other processes within the Flow. More information can be found in the Connected and Disconnected Messages section.
For information on sending responses back to TCP clients, please see the Sending Messages section.
Settings related to the core configuration of the connector.
- Connector Id The static name of the connector. All connector-specific files are held in a folder by the same name within the Data Directory.
- Connector Description An optional field to provide free-form description of the connector and its role in the flow.
- Port The port on which to listen for incoming TCP connections.
Settings related to distinguishing individual messages from the TCP stream.
- Message Start Delimiter The character or string indicating the start of a new message.
- Message End Delimiter The character or string indicating the end of the current message.
- Message Length Offset The number of bytes to skip before beginning to read the length of the message from the incoming data.
- Message Length Size The size in bytes of the length value within the incoming data.
Settings related to SSL/TLS transport security.
- Enable TLS Whether clients must negotiate SSL/TLS encryption to connect to the TCP server.
- Server Certificate The SSL/TLS certificate that identifies the TCP server.
- Certificate Password The password to access the Server Certificate’s private key.
Settings related to the logs maintained by the server.
- Enable Server Log Whether to maintain server-side logging for connections.
- Server Log Rotation The interval according to which logs should be archived (compressed and moved to an archive folder).
- Server Log Rotation The interval according to which logs should be deleted.
Settings related to keep-alive packets sent by the server to maintain an idle connection.
- Keep Alive Whether to send keep-alive packets periodically to ensure that idle connections are not closed due to inactivity.
- Keep Alive Time The length of inactivity that should elapse before sending the first keep-alive packet.
- Keep Alive Interval The interval between consecutive keep-alive packets.
Settings not included in the previous categories.
- Connected Messages Whether the connector should generate an Arc message when a client connects. More information can be found in the Connected and Disconnected Messages section.
- Disconnected Messages Whether the connector should generate an Arc message when a client disconnects. More information can be found in the Connected and Disconnected Messages section.
- Idle Timeout The length of time the server should wait for an idle client before disconnecting them due to inactivity.
- Local File Scheme A filemask for determining local file names as they are downloaded by the connector. The following macros may be used to reference contextual information:
%ConnectorId%, %Filename%, %FilenameNoExt%, %Ext%, %ShortDate%, %LongDate%, %RegexFilename:%, %DateFormat:%.
As an example: %FilenameNoExt%_%ShortDate%%Ext%
- Local Host The binding address of the local server, if not the default network interface.
- Log Level The level of detail included in logs generated for the connector.
- Max Connections The maximum number of concurrent connectors.
- Other An arbitrary set of advanced configuration settings.
- Parent Connector If set to another TCP Server Connector, this connector will inherit settings from that connector. Any local settings will override settings from the parent.
- Log Messages Whether logs from sent files will include a copy of the file itself.
- Save to Sent Folder Whether files sent by the connector should be copied to the Sent folder for the connector.
- SSL/TLS Enabled Protocols The list of SSL/TLS protocols supported when establishing outgoing connections. It is strongly recommended to only use TLS protocols. Some obsolete operating systems do not support TLS 1.2.
Settings for specific use cases.
- Other Settings Allows configuration of hidden connector settings in a semicolon-separated list, like
setting1=value1;setting2=value2. Normal connector use cases and functionality should not require use of these settings.
Trusted IP Addresses
This section defines the IP addresses that are allowed to make connections. The following functions are available:
- Add Opens a modal to enter a new IP address range.
- Edit Opens a modal to modify the selected IP address range.
- Delete Deletes the selected IP address range from the list.
The following restrictions apply to this feature:
localhostcannot be modified or removed from the list.
- Any IP addresses outside of the defined ranges will be rejected.
- Ranges are supported. For example, the entry
22.214.171.124-15indicates that IP addresses between
- CIDR notation is supported. For example, the entry
126.96.36.199/24indicates that IP addresses between
- Wildcard patterns are supported. For example, the entry
100.10.100.*indicates that IP addresses beginning with
Connected and Disconnected Messages
By default, the TCP Server Connector will only generate Arc messages when clients transfer data such that the connector recognizes a full message (according to the settings in the Message Decoding section). The connector can also generate Arc messages when a client connects to the server (if Connected Messages is enabled in the Advanced tab) or disconnects from the server (if Disconnected Messages is enabled in the Advanced tab).
When these special messages are generated, a special header is added to the Arc message:
This header is set to the value ‘connected’ when clients are connecting, and ‘disconnected’ when clients are disconnecting.
This header value must be checked by later connectors in the Flow to detect whether a message written to the output folder of a TCP Server Connector is one of these special messages.
The TCP Server Connector also uses a special header value to send messages back to connected clients:
This header is added to any output messages generated by the connector, set to a ‘Connection ID’ value that uniquely identifies one of the connected clients. Messages that should be sent back to this client must have this same header set to the same value in order to ensure that the message is sent to the appropriate client.
Since this header is already present on any messages written out by the connector, if the message passes through an Arc Flow and arrives back at the Send folder for the TCP Server Connector, it will still have the same ‘Connection ID’ value and will be returned to the same client that sent the original message. If the message cannot be directly routed back to the TCP Server Connector, then the ‘Connection ID’ value must be saved and applied as a header (with the same name listed above) to whatever new messages should be returned to the client.