diff options
-rw-r--r-- | includes/Socket.h | 5 | ||||
-rw-r--r-- | tests/test-Sockets.cc | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/includes/Socket.h b/includes/Socket.h index 3b29f49..c31bdd8 100644 --- a/includes/Socket.h +++ b/includes/Socket.h @@ -57,7 +57,7 @@ class Socket : public Handle { template<class Worker> class Listener : public Task { public: - Listener(int port, const char * local = NULL) : m_stop(false) { + Listener(int port, const char * local = NULL, void * opaque = NULL) : m_stop(false), m_opaque(opaque) { bool r = m_listener.setLocal(local, port); Assert(r); r = m_listener.listen(); @@ -79,7 +79,7 @@ class Listener : public Task { yield(); continue; } - new Worker(io); + new Worker(io, m_opaque); } } void stop() { @@ -93,6 +93,7 @@ class Listener : public Task { Events::Async m_evt; volatile bool m_stop; String m_name; + void * m_opaque; }; }; diff --git a/tests/test-Sockets.cc b/tests/test-Sockets.cc index fd6eaa0..0afedb1 100644 --- a/tests/test-Sockets.cc +++ b/tests/test-Sockets.cc @@ -7,14 +7,14 @@ using namespace Balau; class Worker : public Task { public: - Worker(IO<Socket> io); + Worker(IO<Socket> io, void *); virtual const char * getName(); virtual void Do(); IO<Socket> m_io; String m_name; }; -Worker::Worker(IO<Socket> io) : m_io(io) { +Worker::Worker(IO<Socket> io, void *) : m_io(io) { m_name = m_io->getName(); Printer::log(M_STATUS, "Got connection: %s", m_name.to_charp()); } |