… | |
… | |
1653 | |
1653 | |
1654 | Most members are additionally marked with either I<[read-only]>, meaning |
1654 | Most members are additionally marked with either I<[read-only]>, meaning |
1655 | that, while the watcher is active, you can look at the member and expect |
1655 | that, while the watcher is active, you can look at the member and expect |
1656 | some sensible content, but you must not modify it (you can modify it while |
1656 | some sensible content, but you must not modify it (you can modify it while |
1657 | the watcher is stopped to your hearts content), or I<[read-write]>, which |
1657 | the watcher is stopped to your hearts content), or I<[read-write]>, which |
1658 | means you can expect it to have some sensible content while the watcher |
1658 | means you can expect it to have some sensible content while the watcher is |
1659 | is active, but you can also modify it. Modifying it may not do something |
1659 | active, but you can also modify it (within the same thread as the event |
|
|
1660 | loop, i.e. without creating data races). Modifying it may not do something |
1660 | sensible or take immediate effect (or do anything at all), but libev will |
1661 | sensible or take immediate effect (or do anything at all), but libev will |
1661 | not crash or malfunction in any way. |
1662 | not crash or malfunction in any way. |
1662 | |
1663 | |
1663 | In any case, the documentation for each member will explain what the |
1664 | In any case, the documentation for each member will explain what the |
1664 | effects are, and if there are any additional access restrictions. |
1665 | effects are, and if there are any additional access restrictions. |
… | |
… | |
1829 | =item ev_io_init (ev_io *, callback, int fd, int events) |
1830 | =item ev_io_init (ev_io *, callback, int fd, int events) |
1830 | |
1831 | |
1831 | =item ev_io_set (ev_io *, int fd, int events) |
1832 | =item ev_io_set (ev_io *, int fd, int events) |
1832 | |
1833 | |
1833 | Configures an C<ev_io> watcher. The C<fd> is the file descriptor to |
1834 | Configures an C<ev_io> watcher. The C<fd> is the file descriptor to |
1834 | receive events for and C<events> is either C<EV_READ>, C<EV_WRITE> or |
1835 | receive events for and C<events> is either C<EV_READ>, C<EV_WRITE>, both |
1835 | C<EV_READ | EV_WRITE>, to express the desire to receive the given events. |
1836 | C<EV_READ | EV_WRITE> or C<0>, to express the desire to receive the given |
|
|
1837 | events. |
|
|
1838 | |
|
|
1839 | Note that setting the C<events> to C<0> and starting the watcher is |
|
|
1840 | supported, but not specially optimized - if your program sometimes happens |
|
|
1841 | to generate this combination this is fine, but if it is easy to avoid |
|
|
1842 | starting an io watcher watching for no events you should do so. |
1836 | |
1843 | |
1837 | =item ev_io_modify (ev_io *, int events) |
1844 | =item ev_io_modify (ev_io *, int events) |
1838 | |
1845 | |
1839 | Similar to C<ev_io_set>, but only changes the event mask. Using this might |
1846 | Similar to C<ev_io_set>, but only changes the event mask. Using this might |
1840 | be faster with some backends, as libev can assume that the C<fd> still |
1847 | be faster with some backends, as libev can assume that the C<fd> still |