Skip to content

Commit

Permalink
fixed changing io events for libev
Browse files Browse the repository at this point in the history
  • Loading branch information
Martijn Otto committed Jan 4, 2016
1 parent 7de0fe9 commit 18bf111
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion include/libev.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,14 @@ class LibEvHandler : public TcpHandler
*/
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);
}
};

Expand Down

0 comments on commit 18bf111

Please sign in to comment.