tcp.readStreamUntil

Syntax tcp.readStreamUntil (stream, pattern, timeOutSecs, adrBuffer)

Params stream is a stream reference returned by tcp.openStream.

pattern is a string which is expected to show up in the data to be read.

timeOutSecs is the number of seconds to wait for data to come in before giving up.

adrBuffer is the address of a string to which the incoming data is appended.

Action Reads waiting data from an open TCP/IP connection.

Returns True.

Examples
Notes The data is read from the stream in chunks as it becomes available, appending to the string pointed to by adrBuffer.

Data is only read from the stream as long as the string pointed to by adrBuffer does not contain pattern. If the string already contains pattern in the beginning, we don't attempt to read from the stream.

A timeout error is generated if the connection is idle for more than timeOutSecs seconds.

This verb is new in Frontier 6.1. It's faster and more thread-friendly than using tcp.readStream and tcp.statusStream in a loop.

See also tcp.readStream

tcp.readStreamBytes

tcp.readStreamUntilClosed

Discuss