summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/client/Connector.cpp
diff options
context:
space:
mode:
authorAndrew Stitcher <astitcher@apache.org>2010-01-21 06:17:10 +0000
committerAndrew Stitcher <astitcher@apache.org>2010-01-21 06:17:10 +0000
commitdf3fe9778d87dd256a2d4c08146d86830ac1e8be (patch)
tree23f64b58e3ec94c6024368d1b90910db9d711c84 /cpp/src/qpid/client/Connector.cpp
parent66266d1f34066c5960ae1eb4f28b8c7758cb46c9 (diff)
downloadqpid-python-df3fe9778d87dd256a2d4c08146d86830ac1e8be.tar.gz
QPID-1879 Don't use a thread for every new client Connection
- By default the max number of threads now used for network io is the number of cpus available. - This can be overridden with the QPID_MAX_IOTHREADS environment variable or the config file - The client threads are initialised (via a singleton) when first used in a Connection::open() git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@901550 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/client/Connector.cpp')
-rw-r--r--cpp/src/qpid/client/Connector.cpp24
1 files changed, 6 insertions, 18 deletions
diff --git a/cpp/src/qpid/client/Connector.cpp b/cpp/src/qpid/client/Connector.cpp
index 2c4feffdcf..71a49ad54a 100644
--- a/cpp/src/qpid/client/Connector.cpp
+++ b/cpp/src/qpid/client/Connector.cpp
@@ -21,32 +21,17 @@
#include "qpid/client/Connector.h"
-#include "qpid/client/ConnectionImpl.h"
-#include "qpid/client/ConnectionSettings.h"
+#include "qpid/Exception.h"
#include "qpid/log/Statement.h"
-#include "qpid/sys/Codec.h"
-#include "qpid/sys/Time.h"
-#include "qpid/framing/AMQFrame.h"
-#include "qpid/sys/AsynchIO.h"
-#include "qpid/sys/Dispatcher.h"
-#include "qpid/sys/Poller.h"
-#include "qpid/sys/SecurityLayer.h"
-#include "qpid/Msg.h"
-#include <iostream>
#include <map>
-#include <boost/bind.hpp>
-#include <boost/format.hpp>
namespace qpid {
namespace client {
using namespace qpid::sys;
using namespace qpid::framing;
-using boost::format;
-using boost::str;
-// Stuff for the registry of protocol connectors (maybe should be moved to its own file)
namespace {
typedef std::map<std::string, Connector::Factory*> ProtocolRegistry;
@@ -57,13 +42,15 @@ namespace {
}
}
-Connector* Connector::create(const std::string& proto, framing::ProtocolVersion v, const ConnectionSettings& s, ConnectionImpl* c)
+Connector* Connector::create(const std::string& proto,
+ boost::shared_ptr<Poller> p,
+ framing::ProtocolVersion v, const ConnectionSettings& s, ConnectionImpl* c)
{
ProtocolRegistry::const_iterator i = theProtocolRegistry().find(proto);
if (i==theProtocolRegistry().end()) {
throw Exception(QPID_MSG("Unknown protocol: " << proto));
}
- return (i->second)(v, s, c);
+ return (i->second)(p, v, s, c);
}
void Connector::registerFactory(const std::string& proto, Factory* connectorFactory)
@@ -79,4 +66,5 @@ void Connector::activateSecurityLayer(std::auto_ptr<qpid::sys::SecurityLayer>)
{
}
+
}} // namespace qpid::client