NextGen Knowledge Center

TCP Listener

This source connector listens for messages coming in over a TCP connection. It can either listen on a TCP interface/port and wait for clients to connect, or connect to an external server. There are options to decide when to keep connections open, and how many clients can connect at once. Configurable transmission modes allow you to decide how to receive inbound messages and send responses. When sending responses, you can choose to send the data back on the same connection, or on a new connection.

Supported property groups:

ItemNameDefault ValueDescription
ATransmission ModeMLLPThe transmission mode determines how to receive message data from the incoming byte stream, and how to send responses out. For additional information, see TCP Transmission Modes.
BSample Frame

<VT>

<Message Data>

<FS>

<CR>

An example of a valid incoming message. This is dependent on the Transmission Mode.
CModeServer
  • Select Server to listen for connections from clients.
  • Select Client to connect to a TCP Server. In Client mode, the Listener Settings is only used if Override Local Binding is enabled.
DRemote Address The domain name or IP address on which to connect. Only applicable for Client mode.
ERemote Port The port on which to connect. Only applicable for Client mode.
FOverride Local BindingNo
  • Select Yes to override the local address and port that the client socket will be bound to.
  • Select No to use the default values of 0.0.0.0:0. A local port of zero (0) indicates that the OS should assign an ephemeral port automatically.

Only applicable for Client mode.

GReconnect Interval (ms)5000Enter the time (in milliseconds) to wait between disconnecting from the TCP server and connecting to it again. Only applicable for Client mode.
HMax Connections10The maximum number of client connections to accept. After this number has been reached, subsequent socket requests will be rejected. Only applicable for Server mode.
IReceive Timeout (ms)0The amount of time, in milliseconds, to wait without receiving a message before closing a connection.
JBuffer Size (bytes)65536Useful when you expect to receive large messages. Generally, the default value is fine.
KKeep Connection OpenYes
  • Select Yes to keep the socket open until the sending system closes it. When Yes is selected, the message will only be processed if data is received and either the receive timeout is reached, the remote system closes the socket, or an end-of-message byte sequence has been detected from the Transmission Mode.
  • Select No to close the socket after a received message has finished processing.
LData TypeText
  • Select Binary if the inbound messages are raw byte streams; the payload will be Base64 encoded.
  • Select Text if the inbound messages are textual; the payload will be encoded with the specified character set encoding.
MEncodingDefaultSelect the character set encoding to use when decoding bytes from the TCP stream, or select Default to use the default character set encoding for the JVM Mirth® Connect by NextGen Healthcare is running on.
NRespond on New ConnectionNo
  • Select No to send responses only using the same connection the inbound message was received on.
  • Select Yes to always send responses on a new connection (during normal processing as well as recovery).
  • Select Message Recovery to only send responses on a new connection during message recovery. Connections will be bound locally on the same interface chosen in the Listener Settings with an ephemeral port.
OResponse Address The domain name or IP address to send message responses to.
PResponse Port The port to send message responses to.