IOFuncs

class IOFuncs(*args, **kwargs)

A table of functions used to handle different types of IOChannel in a generic way.

Fields

class IOFuncs
io_close

Closes the channel. This is called from close() after flushing the buffers.

io_create_watch

Creates a watch on the channel. This call corresponds directly to io_create_watch().

io_free

Called from unref() when the channel needs to be freed. This function must free the memory associated with the channel, including freeing the IOChannel structure itself. The channel buffers have been flushed and possibly io_close has been called by the time this function is called.

io_get_flags

Gets the IOFlags for the channel. This function need only return the APPEND and NONBLOCK flags; get_flags() automatically adds the others as appropriate.

io_read

Reads raw bytes from the channel. This is called from various functions such as read_chars() to read raw bytes from the channel. Encoding and buffering issues are dealt with at a higher level.

io_seek

Seeks the channel. This is called from seek() on channels that support it.

io_set_flags

Sets the IOFlags on the channel. This is called from set_flags() with all flags except for APPEND and NONBLOCK masked out.

io_write

Writes raw bytes to the channel. This is called from various functions such as write_chars() to write raw bytes to the channel. Encoding and buffering issues are dealt with at a higher level.