Start of trail quanser.communications.stream.send_double navigation bar

Table of Contents

quanser.communications.stream.flush

Flushes the stream buffer to the underlying communication channel.

Syntax

        would_block = stream.flush;
    

Description

This function flushes the stream buffer. It attempts to send the contents of the buffer over the communication channel. If an error occurs, then it issues an error message. If the connection is closed it is considered an error condition.

If quanser.communications.stream.listen or quanser.communications.stream.connect was called with the non-blocking flag set to false (0), then this function blocks until all the data in the buffer is sent.

If quanser.communications.stream.listen or quanser.communications.stream.connect was called with the non-blocking flag set to true (1), then this function does not block. It attempts to send all the data remaining in the stream buffer. However, if this operation would block then it returns would_block as true (1), even if it has already sent some of the data. In this case, the poll function may be used with the 'flush' flag to determine when at least one more byte may be flushed.

Parameters

stream

Stream handle returned by quanser.communications.stream.connect or accept.

Outputs

would_block

Whether the function would have blocked. Always false for blocking streams.

Examples

        stream.flush;    % Flushes the stream buffer to the underlying communication channel.
    

See Also

 

navigation bar