Back to Adaptive Vision Studio website

You are here: Start » Filter Reference » TCP IP » TcpIp_ReadAllBuffer

TcpIp_ReadAllBuffer


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

Name Type Range Description
inSocket SocketId Connected socket ID, will be closed if successfully read.
inTimeout Integer* 0 - Timeout in milliseconds, block if not specified.
outBuffer ByteBuffer? Buffer with raw received data, or Nil if the operation was interrupted by timeout.
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.

outBuffer is a buffer containing raw binary data (a sequence of bytes). Data buffer can be processed using filters from the Binary Data category.

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.

Examples

Description of usage of this filter can be found in examples and tutorial: IO HTTP Image Download.

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, Adaptive Vision Studio Professional version.

See Also

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