IO Event API

Application can subscribe/unsubscribe I/O events on sockets.

Libre_SetWaitIo

Libre_SetWaitIo(fd, mask)

Subscribe I/O events, or modify the event mask of existing I/O subscription.

Parameters:

  • fd - The socket handle.
  • mask - The event mask.
    • 1 - Wait for read.
    • 2 - Wait for write.
    • 3 - Wait for both read and write.

Note: If the socket handle is a HTTP session, only read event can be subscribed. Application can only wait for HTTP response.

Libre_ClearWaitIo

Libre_ClearWaitIo(fd)

Unsubscribe I/O events.

Parameters:

  • fd - The socket handle.