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


Name of the adapter instance. The instance name is the first entry in the adapter configuration and must be enclosed in square brackets. 


 To run more than one instance of the adapter, specify a unique name and configuration for each adapter instance.

ConnectTimeoutMaximum time, in seconds, to wait until a connection attempt is considered unsuccessful Default:10
EngineType of adapter in use 


Valid value: MA::Adapter::TcpClient

Local IP address on a computer with multiple network interfaces to which the TCP Client Adapter binds 

Specify a value for this parameter only when the adapter is on a computer that has multiple network interfaces. By default, the adapter will bind to the default interface. 

Valid values: host name or IP address


Do not specify localhost127.0.0.1, orINADDR_ANY as a value for this parameter.

LocalPortLocal port number to which the TCP Client Adapter binds Default:ANY
MapfileName of the MAP file used to generate events from the tokenized data 


Parser instance to use to parse and tokenize the client input stream 


You must code the name of another section in themcxa.conf file that defines a parser with a unique name. It is not valid to code the name of a parser type as would be used in the Engine parameter.


Parser = ParseSyslog, whereParseSyslog is the unique name for a parser definition, such as the following: 
Engine = MA::Parser::FixedWidth 
In the adapter definition, do not code as follows: 
Parser = MA::Parser::FixedWidth

RemoteHostHost name or IP address of the remote computer to which the TCP Client Adapter is connecting 

RemotePortPort on the remote computer to which the TCP Client Adapter is connecting 


Interval, in seconds, at which:

  • The TCP Client Adapter reattempts to bind to the local port if that port is busy when the adapter makes its first bind attempt.
  • The TCP Client Adapter sends a packet if the connection that the adapter uses is functioning.


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.


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 =
RemoteHost = localhost
RemotePort = 13       # date/time service


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.

Was this page helpful? Yes No Submitting... Thank you