event/SocketMonitor: use class SocketDescriptor

This commit is contained in:
Max Kellermann
2017-08-10 18:25:22 +02:00
parent fcfc8bacc0
commit 492b20a89d
21 changed files with 80 additions and 83 deletions

View File

@@ -48,7 +48,7 @@ private:
AvahiWatchEvent received;
public:
AvahiWatch(int _fd, AvahiWatchEvent _event,
AvahiWatch(SocketDescriptor _fd, AvahiWatchEvent _event,
AvahiWatchCallback _callback, void *_userdata,
EventLoop &_loop)
:SocketMonitor(_fd, _loop),
@@ -72,7 +72,7 @@ public:
protected:
virtual bool OnSocketReady(unsigned flags) {
received = ToAvahiWatchEvent(flags);
callback(this, Get(), received, userdata);
callback(this, Get().Get(), received, userdata);
received = AvahiWatchEvent(0);
return true;
}
@@ -132,7 +132,7 @@ MyAvahiPoll::WatchNew(const AvahiPoll *api, int fd, AvahiWatchEvent event,
AvahiWatchCallback callback, void *userdata) {
const MyAvahiPoll &poll = *(const MyAvahiPoll *)api;
return new AvahiWatch(fd, event, callback, userdata,
return new AvahiWatch(SocketDescriptor(fd), event, callback, userdata,
poll.event_loop);
}