Start » Filter Reference » System » TCP IP » TcpIp_ReadAllText

TcpIp_ReadAllText


Module: FoundationLite

Receives text from a connected socket until the other side closes connection.

Name Type Range Description
Input value
inSocket SocketId Connected socket ID, will be closed if successfully read.
Input value
inTimeout Integer* 0 - Timeout in milliseconds, block if not specified.
Output value
outText String? Received data as textual string, or Nil if the operation was interrupted by timeout.
Output value
outEof Bool Indicates whether the operation successfully read data to the end of stream.

Description

Reads all data until the other side stops sending and closes the connection on its side.

The inTimeout input specifies the longest possible waiting time, in milliseconds, for the incoming data to be fully received. When no timeout is specified (set to Auto), the execution is blocking. When the filter execution is terminated by timeout condition no data is returned or removed from the input buffer (Nil is returned instead). In such situation the operation can be retried later. When timeout is et to zero the filter performs a single read attempt and returns immediately when no data is available.

Received bytes are interpreted as UTF-8 encoded text and returned on outText output. When received data is not in a valid UTF-8 encoding an IOError is raised.

outEof output is set to True when data was successfully received and the connection is closed by the other side. This output can be used as a more convenient way to detect end of communication in the application.

This filter can raise IoError when the connection is disruptively broken or when other network-related error occurred.

Hints

  • Connect inSocket with the output of TcpIp_Connect or TcpIp_Accept.
  • Set inTimeout if you want the filter to abort waiting for data after a predefined time.

Remarks

User manual

For more information about using this filter, please follow the link: Using TCP/IP Communication.

Complexity Level

This filter is available on Basic Complexity Level.

Disabled in Lite Edition

This filter is disabled in Lite Edition. It is available only in full, Aurora Vision Studio Professional version.

See Also

  • TcpIp_ReadLine – Reads from a connected TCP socket until receiving a specific sequence.
  • TcpIp_Close – Closes a connected TCP socket gracefully.