From b9a69463aae6e99cd6428016fc4cd05061165ad5 Mon Sep 17 00:00:00 2001 From: Pixel Date: Mon, 14 Nov 2011 17:47:01 -0800 Subject: If I'm having a wrapper class around Handles, it's for a reason... --- includes/Socket.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'includes/Socket.h') diff --git a/includes/Socket.h b/includes/Socket.h index c31bdd8..101c467 100644 --- a/includes/Socket.h +++ b/includes/Socket.h @@ -57,12 +57,12 @@ class Socket : public Handle { template class Listener : public Task { public: - Listener(int port, const char * local = NULL, void * opaque = NULL) : m_stop(false), m_opaque(opaque) { - bool r = m_listener.setLocal(local, port); + Listener(int port, const char * local = NULL, void * opaque = NULL) : m_listener(new Socket), m_stop(false), m_opaque(opaque) { + bool r = m_listener->setLocal(local, port); Assert(r); - r = m_listener.listen(); + r = m_listener->listen(); Assert(r); - m_name = String(ClassName(this).c_str()) + " - " + m_listener.getName(); + m_name = String(ClassName(this).c_str()) + " - " + m_listener->getName(); Printer::elog(E_SOCKET, "Created a listener task at %p", this); } virtual void Do() { @@ -71,7 +71,7 @@ class Listener : public Task { while (!m_stop) { IO io; try { - io = m_listener.accept(); + io = m_listener->accept(); } catch (EAgain) { Printer::elog(E_SOCKET, "Listener task at %p (%s) got an EAgain - stop = %s", this, ClassName(this).c_str(), m_stop ? "true" : "false"); @@ -89,7 +89,7 @@ class Listener : public Task { } virtual const char * getName() { return m_name.to_charp(); } private: - Socket m_listener; + IO m_listener; Events::Async m_evt; volatile bool m_stop; String m_name; -- cgit v1.2.3