diff options
author | Max Kellermann <max@duempel.org> | 2013-01-15 22:48:38 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-01-15 22:56:06 +0100 |
commit | a0ebd444ad52e00d23abca606819257fcb48889b (patch) | |
tree | 95be45b69a6db4f3d1ac7d831cd04d590bba59ca /src/event/SocketMonitor.hxx | |
parent | 0c6072c4e4e442433f3b19c26d8332219a4666a1 (diff) | |
download | mpd-a0ebd444ad52e00d23abca606819257fcb48889b.tar.gz mpd-a0ebd444ad52e00d23abca606819257fcb48889b.tar.xz mpd-a0ebd444ad52e00d23abca606819257fcb48889b.zip |
event/SocketMonitor: add method Open()
Allow creating a closed SocketMonitor instance.
Diffstat (limited to '')
-rw-r--r-- | src/event/SocketMonitor.hxx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/event/SocketMonitor.hxx b/src/event/SocketMonitor.hxx index ca3c5dcc4..236e5fbda 100644 --- a/src/event/SocketMonitor.hxx +++ b/src/event/SocketMonitor.hxx @@ -54,6 +54,9 @@ public: static constexpr unsigned ERROR = G_IO_ERR; static constexpr unsigned HANGUP = G_IO_HUP; + SocketMonitor(EventLoop &_loop) + :fd(-1), loop(_loop), source(nullptr) {} + SocketMonitor(int _fd, EventLoop &_loop); ~SocketMonitor(); @@ -68,6 +71,8 @@ public: return fd; } + void Open(int _fd); + void Close(); void Schedule(unsigned flags) { |