fixed changing io events for libev

This commit is contained in:
Martijn Otto 2016-01-04 16:53:22 +01:00
parent 7de0fe94ac
commit 18bf111eec
1 changed files with 7 additions and 1 deletions

View File

@ -100,8 +100,14 @@ private:
*/
void events(int events)
{
// libev has a function for this
// stop the watcher if it was active
ev_io_stop(_loop, &_io);
// set the events
ev_io_set(&_io, _io.fd, events);
// and restart it
ev_io_start(_loop, &_io);
}
};