View Source inert (inert v1.0.5)

Link to this section Summary

Functions

Clear read_write events for a file descriptor.
Clear an event set for a file descriptor.
Monitor a file descriptor for read events.

Monitor a file descriptor for events.

Block until a file descriptor is ready for reading.
Block until a file descriptor is ready for reading or writing.

Block until a file descriptor is ready for reading or writing.

Retrieves the port identifier for the inert driver.
Start the inert service.
Stop the inert service.

Link to this section Functions

-spec fdclr(integer()) -> ok | inert_drv:errno().
Clear read_write events for a file descriptor.
-spec fdclr(integer(), inert_drv:mode() | proplists:proplist()) -> ok | inert_drv:errno().
Clear an event set for a file descriptor.
-spec fdset(integer()) -> ok | inert_drv:errno().
Monitor a file descriptor for read events.
-spec fdset(integer(), inert_drv:mode() | proplists:proplist()) -> ok | inert_drv:errno().

Monitor a file descriptor for events.

fdset/1,2 will send one message when a file descriptor is ready for reading or writing:

{inert_read, PollId, FD} % fd is ready for reading {inert_write, PollId, FD} % fd is ready for writing

Use pollid/0 to retrieve the descriptor for the inert driver.

When requesting a monitoring mode of read_write, the calling process may receive two messages (one for read, one for write).

Further events are not monitored after the message is sent. To re-enable monitoring, fdset/2,3 must be called again.

Successive calls to fdset/2,3 reset the mode:
-spec poll(integer()) -> {ok, read} | {error, timeout} | inert_drv:errno().
Block until a file descriptor is ready for reading.
-spec poll(integer(), inert_drv:mode() | proplists:proplist()) ->
        {ok, read | write} | {error, timeout} | inert_drv:errno().
Block until a file descriptor is ready for reading or writing.
-spec poll(integer(), inert_drv:mode() | proplists:proplist(), timeout()) ->
        {ok, read | write} | {error, timeout} | inert_drv:errno().

Block until a file descriptor is ready for reading or writing.

The timeout option will interrupt poll/3 after the specified timeout (in milliseconds), returning the tuple {error, timeout}.
-spec pollid() -> undefined | port().
Retrieves the port identifier for the inert driver.
Start the inert service.
Stop the inert service.