aboutsummaryrefslogtreecommitdiffstats
path: root/src/event/SocketMonitor.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/event/SocketMonitor.hxx')
-rw-r--r--src/event/SocketMonitor.hxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/event/SocketMonitor.hxx b/src/event/SocketMonitor.hxx
index ddfc21a42..b8ded1967 100644
--- a/src/event/SocketMonitor.hxx
+++ b/src/event/SocketMonitor.hxx
@@ -24,7 +24,10 @@
#include <glib.h>
+#include <type_traits>
+
#include <assert.h>
+#include <stddef.h>
#ifdef WIN32
/* ERRORis a WIN32 macro that poisons our namespace; this is a
@@ -54,6 +57,8 @@ public:
static constexpr unsigned ERROR = G_IO_ERR;
static constexpr unsigned HANGUP = G_IO_HUP;
+ typedef std::make_signed<size_t>::type ssize_t;
+
SocketMonitor(EventLoop &_loop)
:fd(-1), loop(_loop), source(nullptr) {}
@@ -106,6 +111,9 @@ public:
poll.events &= ~WRITE;
}
+ ssize_t Read(void *data, size_t length);
+ ssize_t Write(const void *data, size_t length);
+
protected:
virtual void OnSocketReady(unsigned flags) = 0;