From 2ca2ef499eef0ebb1716857fc27121c0c4c3f2e3 Mon Sep 17 00:00:00 2001 From: Pixel Date: Tue, 15 Nov 2011 10:47:09 -0800 Subject: Fixing the Socket code a bit, effectively making the listener system working. --- includes/Socket.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'includes/Socket.h') diff --git a/includes/Socket.h b/includes/Socket.h index d5e58f6..31830e1 100644 --- a/includes/Socket.h +++ b/includes/Socket.h @@ -34,9 +34,9 @@ class Socket : public Handle { Socket(int fd); class SocketEvent : public Events::BaseEvent { public: - SocketEvent(int fd, int evt = EV_READ | EV_WRITE) : m_task(NULL) { Printer::elog(E_SOCKET, "Got a new SocketEvent at %p", this); m_evt.set(this); m_evt.set(fd, evt); } - virtual ~SocketEvent() { m_evt.stop(); } - void stop() { reset(); m_evt.stop(); } + SocketEvent(int fd, int evt = ev::READ | ev::WRITE) : m_task(NULL) { Printer::elog(E_SOCKET, "Got a new SocketEvent at %p", this); m_evt.set(this); m_evt.set(fd, evt); } + virtual ~SocketEvent() { Printer::elog(E_SOCKET, "Destroying a SocketEvent at %p", this); m_evt.stop(); } + void stop() { Printer::elog(E_SOCKET, "Stopping a SocketEvent at %p", this); reset(); m_evt.stop(); } private: void evt_cb(ev::io & w, int revents) { Printer::elog(E_SOCKET, "Got a libev callback on a SocketEvent at %p", this); doSignal(); } virtual void gotOwner(Task * task); -- cgit v1.2.3