For the complete documentation index, see llms.txt. This page is also available as Markdown.

Receive

Starts an MLLP server that collects incoming HL7 messages for the configured duration.

Task version: 2.1.0

Required Frends version: 5.7+

Required .NET version: 8.0

Compatible Agents: Crossplatform

Task Parameters

Name
Description

ListenAddress : String

IP address or hostname to bind to. Leave empty to listen on all interfaces.

Default: - Example: 127.0.0.1

Port : Int32

TCP port the server listens on.

Default: 2575 Example: 2575

Name
Description

TlsMode : TlsMode

The TLS encryption mode to use for the connection.

Possible values:

  • None: No encryption. Data is sent in plain text (standard TCP).

  • Mtls: Mutual TLS. Both client and server must provide valid certificates to establish a secure, encrypted connection.

Default: None Example: TlsMode.None

ServerCertPath : String

Path to the server certificate file (PFX or P12 format).

Required only for MTLS mode.

Default: - Example: C:\certs\client.pfx

🗝ServerCertPassword : String

Password for the server certificate.

Default: - Example: MyStrongPassword123

ListenDurationSeconds : Int32

How long the listener waits for incoming messages before shutting down. Value in seconds.

Default: 30 Example: 30

BufferSize : Int32

Size of the buffer used when reading data from clients.

Default: 8192 Example: 8192

SendAcknowledgement : Boolean

Whether to send a simple acknowledgement for each message.

Default: True Example: true

AcknowledgementType : AcknowledgementType

ACK type to use. AA = Application Accept, AE = Application Error, AR = Application Reject.

Possible values:

  • AA: Application Accept

  • AE: Application Error

  • AR: Application Reject

Default: AA Example: AA

AckSenderApplication : String

Sender application name (MSH-3) used in the generated ACK message.

If empty, uses the receiving application (MSH-5) from the incoming message.

Default: - Example: ACK_APP

AckReceiverApplication : String

Receiver application name (MSH-5) used in the generated ACK message.

If empty, uses the sending application (MSH-3) from the incoming message.

Default: - Example: SENDING_APP

AckHl7Version : String

HL7 version used in the generated ACK message (MSH-12).

If empty, uses the version from the incoming message.

Default: - Example: 2.5

IgnoreClientCertificateErrors : Boolean

If enabled, the server will accept client certificates even if they are

self-signed or have validation errors (Mutual TLS only).

Default: False Example: false

ClientCertificateThumbprints : String[]

Expected client certificate thumbprint(s) for validation.

Only used when IgnoreClientCertificateErrors is false.

Used in MTLS mode for certificate pinning.

Default: - Example: E5FA62B8B5F3B0B2B3B4B5B6B7B8B9B0B1B2B3B

Encoding : FileEncoding

Encoding used to read incoming HL7 messages.

Possible values:

  • UTF8: UTF-8 encoding.

  • Default: The system default encoding.

  • ASCII: ASCII encoding.

  • Unicode: Unicode (UTF-16) encoding.

  • Windows1252: Windows-1252 encoding.

  • Other: A custom encoding specified as a string.

Default: UTF8 Example: FileEncoding.UTF8

EncodingInString : String

Custom encoding name, used when Encoding is set to Other.

Default: - Example: iso-8859-1

Name
Description

StartBlockByte : Byte

The MLLP start-block framing byte (decimal). Default is 11 (0x0B, vertical tab).

Default: 11 Example: 11

EndBlockByte : Byte

The MLLP end-block framing byte (decimal). Default is 28 (0x1C, file separator).

Default: 28 Example: 28

CarriageReturnByte : Byte

The MLLP end-of-block trailer byte (decimal). Default is 13 (0x0D, carriage return).

Default: 13 Example: 13

CarriageReturnRequired : Boolean

Whether the CarriageReturn character is required. If false, EndBlock marks end of message.

Default: True Example: true

MaxConcurrentConnections : Int32

Maximum number of concurrent connections allowed. 0 means unlimited.

Default: 0 Example: 10

MaxMessageSize : Int32

Maximum message size in bytes. Messages exceeding this limit will be rejected. 0 means unlimited.

Default: 0 Example: 1048576

AcknowledgementFormat : AcknowledgementFormat

Format used for outbound acknowledgement responses.

Possible values:

  • Hl7: Sends a standard HL7 ACK message wrapped in configured framing bytes.

  • ControlByte: Sends a framed single-byte control acknowledgement.

Default: Hl7 Example: AcknowledgementFormat.Hl7

AcknowledgementByte : Byte

Positive acknowledgement control byte used when AcknowledgementFormat is set to ControlByte.

Default: 6 Example: 6

EnableLogging : Boolean

Enable message processing logging to file.

Default: False Example: true

LogFilePath : String

File path for logging message processing events. If not specified, logs to a default location.

Default: - Example: C:\Logs\mllp-messages.log

LogMessageContent : Boolean

Include full message content in logs. If false, only logs message metadata and status.

Default: False Example: false

WriteMessagesToFile : Boolean

When enabled, messages are written directly to temp files during receive,

reducing memory usage.

Note: uses synchronous file I/O which may impact

throughput under high load. Output contains file paths instead of message content.

Users are responsible for managing and deleting files.

Default: False Example: false

MessageOutputDirectory : String

Directory for temp files when WriteMessagesToFile is enabled.

If empty, uses system temp directory.

Default: - Example: C:\Temp\mllp

ThrowErrorOnFailure : Boolean

Whether to throw an error on failure.

Default: True Example: false

ErrorMessageOnFailure : String

Overrides the error message on failure.

Default: - Example: Custom error message

Task Result

Name
Description

Success : Boolean

Indicates if the task completed successfully. Example: true

Output : String[]

Messages received while the listener was running. Example: ACK

Error : Error

Error that occurred during task execution. Example: object { string Message, Exception AdditionalInfo }

Error.Message : String

Summary of the error. Example: Unable to receive HL7 message.

Error.AdditionalInfo : Exception

Additional information about the error. Example: object { Exception AdditionalInfo }

Task Changelog

Changelog for Task Frends.Mllp.Receive.

[2.1.0] - 2026-08-06

Changed

  • Updated package copyright to comply with Frends task standards.

[2.0.0] - 2026-06-05

Added

  • WriteMessagesToFile and MessageOutputDirectory options to handle streaming messages to temp files instead of memory - Output returns file paths. Users are responsible for managing temp files.

  • MaxConcurrentConnections option to limit simultaneous connections - excess connections are rejected and logged.

  • MaxMessageSize option to reject oversized messages with a NACK.

  • EnableLogging, LogFilePath and LogMessageContent options to log message events to a file.

  • StartBlockByte, EndBlockByte, CarriageReturnByte and CarriageReturnRequired options to configure MLLP framing.

  • AcknowledgementFormat, AckSenderApplication, AckReceiverApplication, AckHl7Version and AcknowledgementType options to configure ACK/NACK behavior.

Changed

  • ACK generation now uses only the MSH line instead of full payload - fixes crash on large messages.

  • [Breaking change] AcknowledgementMessage renamed to AcknowledgementType in Connection and changed from string to AcknowledgementType enum. Valid values: AA, AE, AR.

[1.4.0] - 2026-05-18

Added

  • Options.AcknowledgementFormat with Hl7 (default) and ControlByte to configure outbound acknowledgement format.

  • Options.AcknowledgementByte (default 0x06) for the positive control-byte acknowledgement value.

[1.3.0] - 2026-05-06

Added

  • Options.StartBlockByte, Options.EndBlockByte, and Options.CarriageReturnByte to allow configuring MLLP framing bytes (defaults: 11, 28, 13)

[1.2.0] - 2026-04-17

Added

  • Connection.ClientCertificateThumbprints property to specify client certificate thumbprints for authentication in MTLS mode

[1.1.0] - 2026-04-13

Added

  • Connection.Encoding is now selectable and can be set custom by user

[1.0.0] - 2026-02-06

Added

  • Initial implementation

Last updated

Was this helpful?