… | |
… | |
1829 | =item ev_io_init (ev_io *, callback, int fd, int events) |
1829 | =item ev_io_init (ev_io *, callback, int fd, int events) |
1830 | |
1830 | |
1831 | =item ev_io_set (ev_io *, int fd, int events) |
1831 | =item ev_io_set (ev_io *, int fd, int events) |
1832 | |
1832 | |
1833 | Configures an C<ev_io> watcher. The C<fd> is the file descriptor to |
1833 | 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 |
1834 | 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. |
1835 | C<EV_READ | EV_WRITE> or C<0>, to express the desire to receive the given |
|
|
1836 | events. |
|
|
1837 | |
|
|
1838 | Note that setting the C<events> to C<0> and starting the watcher is |
|
|
1839 | supported, but not specially optimized - if your program sometimes happens |
|
|
1840 | to generate this combination this is fine, but if it is easy to avoid |
|
|
1841 | starting an io watcher watching for no events you should do so. |
1836 | |
1842 | |
1837 | =item ev_io_modify (ev_io *, int events) |
1843 | =item ev_io_modify (ev_io *, int events) |
1838 | |
1844 | |
1839 | Similar to C<ev_io_set>, but only changes the event mask. Using this might |
1845 | 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 |
1846 | be faster with some backends, as libev can assume that the C<fd> still |
… | |
… | |
4260 | method. |
4266 | method. |
4261 | |
4267 | |
4262 | For C<ev::embed> watchers this method is called C<set_embed>, to avoid |
4268 | For C<ev::embed> watchers this method is called C<set_embed>, to avoid |
4263 | clashing with the C<set (loop)> method. |
4269 | clashing with the C<set (loop)> method. |
4264 | |
4270 | |
|
|
4271 | For C<ev::io> watchers there is an additional C<set> method that acepts a |
|
|
4272 | new event mask only, and internally calls C<ev_io_modfify>. |
|
|
4273 | |
4265 | =item w->start () |
4274 | =item w->start () |
4266 | |
4275 | |
4267 | Starts the watcher. Note that there is no C<loop> argument, as the |
4276 | Starts the watcher. Note that there is no C<loop> argument, as the |
4268 | constructor already stores the event loop. |
4277 | constructor already stores the event loop. |
4269 | |
4278 | |