# WSETBUFFER
Updated: 1/18/2021, 4:08:04 PM
Created: 1/18/2021, 4:08:04 PM
Last Updated By: Mike Street
Read Time: 1 minute(s)
The WSETBUFFER
subroutine enables or disables buffering of content passed to the WSEND
subroutine. It accepts a single argument, specifying the buffer size in characters, or 0
to disable buffering. Buffering may improve performance, and also may aid in producing cleaner output, especially if your handler displays spurious error or warning messages. Be sure to specify a buffer size sufficient for the content created by your handler. Otherwise, when the buffer exceeds the buffer size, all headers and buffered content are sent to the client, and further buffering is disabled.
When buffering is enabled, all content passed to WSEND
is buffered. A final call to WFLUSH
is used to send the complete response to the client, including all the headers and buffered content. The first header sent by WSEND
, Content-Type
, indicates the beginning of the response, so any error or warning messages generated before the call to WFLUSH
are discarded when buffering is enabled.
Buffering is disabled by default.
# WSETBUFFER Syntax
CALL WSETBUFFER(BUF.SIZE)
# Syntax Elements
Parameter | Description |
---|---|
BUF.SIZE | Maximum number of characters to buffer, or 0 to disable buffering. |