TCP Client Adapter
The TCP Client Adapter connects to a TCP Server to receive a data stream. The adapter passes the data stream to a parser. The parser parses the data stream into data tokens, which the mapping function converts into events.
The following table describes the TCP Client Adapter parameters.
TCP Client Adapter configuration parameters
Parameter | Description | |
---|---|---|
instanceName | Name of the adapter instance. The instance name is the first entry in the adapter configuration and must be enclosed in square brackets. Note To run more than one instance of the adapter, specify a unique name and configuration for each adapter instance. | |
ConnectTimeout | Maximum time, in seconds, to wait until a connection attempt is considered unsuccessful Default:10 | |
Engine | Type of adapter in use Required Valid value: MA::Adapter::TcpClient | |
LocalHost | Local IP address on a computer with multiple network interfaces to which the TCP Client Adapter binds Note Do not specify localhost, 127.0.0.1, orINADDR_ANY as a value for this parameter. | |
LocalPort | Local port number to which the TCP Client Adapter binds Default:ANY | |
Mapfile | Name of the MAP file used to generate events from the tokenized data Required | |
Parser | Parser instance to use to parse and tokenize the client input stream
| |
RemoteHost | Host name or IP address of the remote computer to which the TCP Client Adapter is connecting Required | |
RemotePort | Port on the remote computer to which the TCP Client Adapter is connecting Required | |
RestartInterval | Interval, in seconds, at which:
Note If the current connection fails or the remote server stops responding, this parameter value is also used to schedule additional connection attempts by the adapter. Default:60 |
The following figure shows a sample TCP Client Adapter configuration, as it would appear in the mcxa.conf file.
Sample TCP Client Adapter configuration
[TcpClient] DISABLE
Engine = MA::Adapter::TCPClient
Parser = SeparatorParser
MapFile = mctcpclt.map
RemoteHost = localhost
RemotePort = 13 # date/time service
Diagnostics
All adapter errors are logged as events. Optionally, you can enable tracing by setting the tracing parameters in the global section of the mcxa.conf file.
The TCP Client Adapter can generate an ERR_RECV
error, which indicates that a problem occurred when receiving data from the server. For more information, see the event that is created for this error.
Comments
Log in or register to comment.