TCP Server Adapter
The TCP Server Adapter receives connections from one or more TCP clients. These clients send data streams to the adapter. 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.
You cannot use Telnet as a means for communicating with the TCP Server Adapter. The TCP Server Adapter does not recognize incoming Telnet commands as meaningful binary control codes. Instead, the adapter interprets Telnet information as raw data.
The following table describes the TCP Client Adapter parameters.
TCP Server 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.
|Type of adapter in use |
Valid value: MA::Adapter::TcpServer
Local IP address on a computer with multiple network interfaces to which the TCP Server adapter binds
Do not specify localhost, 127.0.0.1, orINADDR_ANY as a value for this parameter.
|Local port number on which the TCP Server Adapter listens for connections |
|Name of the MAP file used to generate events from the tokenized data |
|Maximum number of clients allowed to connect simultaneously to the TCP Server Adapter |
Parser instance that must be used to parse and tokenize the client input stream
|Interval, in seconds, at which the TCP Server Adapter reattempts to bind to the local port if that port is busy when the adapter makes its first bind attempt |
The following figure shows a sample TCP Server Adapter configuration, as it would appear in the mcxa.conf file.
Sample TCP Server Adapter Configuration
[MyTcpServer] Engine = MA::Adapter::TcpServer MaxClients = 10 RestartInterval = 30 MapFile = mctcpsrv.map LocalHost = 127.0.0.5 LocalPort = 1999 Parser = MyFixedWidthParser
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. For more information, see About the mcxa.conf file.
The TCP Server 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.