stream_send_double_array stream_print navigation bar

Table of Contents

stream_flush

Flushes the stream buffer to the underlying communication channel.

Syntax

would_block = stream_flush(stream);
    

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 stream_listen or 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 stream_listen or 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 stream_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 stream_connect or stream_accept.

Outputs

would_block

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

Examples

stream_flush(stream);    % Flushes the stream buffer to the underlying communication channel.
    

See Also

 

navigation bar