summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/sys
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2008-02-11 21:50:17 +0000
committerAlan Conway <aconway@apache.org>2008-02-11 21:50:17 +0000
commit29ea463bc8d95378baf08b1b7049051fe16879af (patch)
treeb2f6befb89ded56bc2bc57b73a2074ab11ab1d16 /cpp/src/qpid/sys
parentbec646624414b34979c685e196fb66e4e7cad642 (diff)
downloadqpid-python-29ea463bc8d95378baf08b1b7049051fe16879af.tar.gz
Remove dependency on sys::Socket for management ID of connections.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@620622 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/sys')
-rw-r--r--cpp/src/qpid/sys/AsynchIOAcceptor.cpp4
-rw-r--r--cpp/src/qpid/sys/ConnectionInputHandlerFactory.h10
2 files changed, 10 insertions, 4 deletions
diff --git a/cpp/src/qpid/sys/AsynchIOAcceptor.cpp b/cpp/src/qpid/sys/AsynchIOAcceptor.cpp
index 65d805e492..9fd32add72 100644
--- a/cpp/src/qpid/sys/AsynchIOAcceptor.cpp
+++ b/cpp/src/qpid/sys/AsynchIOAcceptor.cpp
@@ -140,7 +140,7 @@ class AsynchIOHandler : public qpid::sys::ConnectionOutputHandler {
void AsynchIOAcceptor::accepted(Poller::shared_ptr poller, const Socket& s, ConnectionInputHandlerFactory* f) {
AsynchIOHandler* async = new AsynchIOHandler;
- ConnectionInputHandler* handler = f->create(async, s);
+ ConnectionInputHandler* handler = f->create(async, s.getPeerAddress());
AsynchIO* aio = new AsynchIO(s,
boost::bind(&AsynchIOHandler::readbuff, async, _1, _2),
boost::bind(&AsynchIOHandler::eof, async, _1),
@@ -194,7 +194,7 @@ void AsynchIOAcceptor::connect(const std::string& host, int16_t port, Connection
socket->connect(host, port);
AsynchIOHandler* async = new AsynchIOHandler;
async->setClient();
- ConnectionInputHandler* handler = f->create(async, *socket);
+ ConnectionInputHandler* handler = f->create(async, socket->getPeerAddress());
AsynchIO* aio = new AsynchIO(*socket,
boost::bind(&AsynchIOHandler::readbuff, async, _1, _2),
boost::bind(&AsynchIOHandler::eof, async, _1),
diff --git a/cpp/src/qpid/sys/ConnectionInputHandlerFactory.h b/cpp/src/qpid/sys/ConnectionInputHandlerFactory.h
index 4a90f8b736..2b309b5758 100644
--- a/cpp/src/qpid/sys/ConnectionInputHandlerFactory.h
+++ b/cpp/src/qpid/sys/ConnectionInputHandlerFactory.h
@@ -22,7 +22,7 @@
#define _ConnectionInputHandlerFactory_
#include <boost/noncopyable.hpp>
-#include "qpid/sys/Socket.h"
+#include <string>
namespace qpid {
namespace sys {
@@ -37,7 +37,13 @@ class ConnectionInputHandler;
class ConnectionInputHandlerFactory : private boost::noncopyable
{
public:
- virtual ConnectionInputHandler* create(ConnectionOutputHandler* ctxt, const Socket& s) = 0;
+ /**
+ *@param out handler for connection output.
+ *@param id identify the connection for management purposes.
+ */
+ virtual ConnectionInputHandler* create(ConnectionOutputHandler* out,
+ const std::string& id) = 0;
+
virtual ~ConnectionInputHandlerFactory(){}
};