Extracted from Pike v7.3 release 53 at 2002-09-10.
pike.ida.liu.se
[Top]
Stdio
Stdio.File

Method Stdio.File()->set_nonblocking()


Method set_nonblocking

void set_nonblocking(function(mixed:void) read_callback, function(mixed:void) write_callback, function(mixed:void) close_callback)
void set_nonblocking(function(mixed:void) read_callback, function(mixed:void) write_callback, function(mixed:void) close_callback, function(mixed:void) read_oob_callback, function(mixed:void) write_oob_callback)
void set_nonblocking()

Description

This function sets a stream to nonblocking mode. When data arrives on the stream, read_callback will be called with some or all of this data. When the stream has buffer space over for writing, write_callback will be called so that you can write more data to it. If the stream is closed at the other end, close_callback will be called.

When out-of-band data arrives on the stream, read_oob_callback will be called with some or all of this data. When the stream allows out-of-band data to be sent, write_oob_callback will be called so that you can write out-of-band data to it.

All callbacks will have the id of file as first argument when called (see Stdio.File.set_id).

If no arguments are given, the callbacks will not be changed. The stream will just be set to nonblocking mode.

Note

Out-of-band data will note be supported if Pike was compiled with the option '--without-oob'.

See also

Stdio.File.set_blocking, Stdio.File.set_id, Stdio.File.set_read_callback, Stdio.File.set_write_callback, Stdio.File.set_close_callback