Home Contents | # rawio:blocking | Rawio | Core4 Lua Event System

## SYNOPSIS

1. handle:blocking(flag)
2. flag = handle:blocking()

## DESCRIPTION

First variant enables or disables blocking mode of the file handle, while second variant returns the current state of the blocking mode flag.

In blocking mode, operations on a file that cannot complete immediately will cause the application to stop (block) until completion. Examples are reading from a serial port that has no data received yet or waiting for incoming network connections on a TCP server socket.

In non-blocking mode, no subsequent operation on the open file will cause the calling process to wait. Instead, all functions that would cause a wait will instead return an error indicating that condition.

## RETURN VALUE

Second variant returns a boolean, with true indicating blocking mode.

## SEE ALSO

rawio.attach, rawio:canReadLine, rawio:clearError, rawio:close, rawio:connect, rawio:detach, rawio:lastError, rawio:line, rawio:lines, rawio.access, rawio.open, rawio:read, rawio:slurp, rawio:copy, rawio.stat, rawio.statfs, rawio:writet, rawio:writes, rawio:write