diff options
author | Pixel <pixel@nobis-crew.org> | 2011-11-15 10:47:09 -0800 |
---|---|---|
committer | Pixel <pixel@nobis-crew.org> | 2011-11-15 10:47:09 -0800 |
commit | 2ca2ef499eef0ebb1716857fc27121c0c4c3f2e3 (patch) | |
tree | 1f106ef5b1e85ed007f831ba0f1b3bd8bfc9c5b5 /includes | |
parent | 0173f9a80775821439a02adaa9535505cbfa9ec5 (diff) |
Fixing the Socket code a bit, effectively making the listener system working.
Diffstat (limited to 'includes')
-rw-r--r-- | includes/Socket.h | 6 |
1 files changed, 3 insertions, 3 deletions
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<SocketEvent, &SocketEvent::evt_cb>(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<SocketEvent, &SocketEvent::evt_cb>(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); |