From a0ebd444ad52e00d23abca606819257fcb48889b Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 15 Jan 2013 22:48:38 +0100 Subject: event/SocketMonitor: add method Open() Allow creating a closed SocketMonitor instance. --- src/event/SocketMonitor.hxx | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/event/SocketMonitor.hxx') 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) { -- cgit v1.2.3