diff options
| author | Gordon Sim <gsim@apache.org> | 2008-04-29 20:15:18 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2008-04-29 20:15:18 +0000 |
| commit | acc0dee435e1fa22e3b1e7cdfecf6913bf88988e (patch) | |
| tree | 729f7a03543acf23380e68897f8788a3e6b45e2e /cpp/src/qpid/client/ConnectionHandler.cpp | |
| parent | a19ce3b1863f80c1232ec2690cd920325a39d71a (diff) | |
| download | qpid-python-acc0dee435e1fa22e3b1e7cdfecf6913bf88988e.tar.gz | |
QPID-974: allow the size of the queue of outgoing frames to be restricted
QPID-544: tidy up configuration (ensuring desired settings are used correctly,
allowing tcp socket options to be set etc)
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@652083 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/client/ConnectionHandler.cpp')
| -rw-r--r-- | cpp/src/qpid/client/ConnectionHandler.cpp | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/cpp/src/qpid/client/ConnectionHandler.cpp b/cpp/src/qpid/client/ConnectionHandler.cpp index df27942008..81d966d53f 100644 --- a/cpp/src/qpid/client/ConnectionHandler.cpp +++ b/cpp/src/qpid/client/ConnectionHandler.cpp @@ -20,9 +20,9 @@ */ #include "ConnectionHandler.h" + #include "qpid/log/Statement.h" #include "qpid/framing/amqp_framing.h" -#include "qpid/framing/AMQP_HighestVersion.h" #include "qpid/framing/all_method_bodies.h" #include "qpid/framing/ClientInvoker.h" #include "qpid/framing/reply_exceptions.h" @@ -42,17 +42,10 @@ const std::string INVALID_STATE_OPEN_OK("open-ok received in invalid state"); const std::string INVALID_STATE_CLOSE_OK("close-ok received in invalid state"); } -ConnectionHandler::ConnectionHandler() - : StateManager(NOT_STARTED), outHandler(*this), proxy(outHandler), errorCode(200) -{ - - mechanism = PLAIN; - locale = en_US; - heartbeat = 0; - maxChannels = 32767; - maxFrameSize = 65535; +ConnectionHandler::ConnectionHandler(const ConnectionSettings& s, framing::ProtocolVersion& v) + : StateManager(NOT_STARTED), ConnectionSettings(s), outHandler(*this), proxy(outHandler), errorCode(200), version(v) +{ insist = true; - version = framing::highestProtocolVersion; ESTABLISHED.insert(FAILED); ESTABLISHED.insert(CLOSED); @@ -141,7 +134,7 @@ void ConnectionHandler::start(const FieldTable& /*serverProps*/, const Array& /* checkState(NOT_STARTED, INVALID_STATE_START); setState(NEGOTIATING); //TODO: verify that desired mechanism and locale are supported - string response = ((char)0) + uid + ((char)0) + pwd; + string response = ((char)0) + username + ((char)0) + password; proxy.startOk(properties, mechanism, response, locale); } @@ -150,14 +143,16 @@ void ConnectionHandler::secure(const std::string& /*challenge*/) throw NotImplementedException("Challenge-response cycle not yet implemented in client"); } -void ConnectionHandler::tune(uint16_t channelMax, uint16_t /*frameMax*/, uint16_t /*heartbeatMin*/, uint16_t /*heartbeatMax*/) +void ConnectionHandler::tune(uint16_t maxChannelsProposed, uint16_t maxFrameSizeProposed, + uint16_t /*heartbeatMin*/, uint16_t /*heartbeatMax*/) { checkState(NEGOTIATING, INVALID_STATE_TUNE); - //TODO: verify that desired heartbeat and max frame size are valid - maxChannels = channelMax; + maxChannels = std::min(maxChannels, maxChannelsProposed); + maxFrameSize = std::min(maxFrameSize, maxFrameSizeProposed); + //TODO: implement heartbeats and check desired value is in valid range proxy.tuneOk(maxChannels, maxFrameSize, heartbeat); setState(OPENING); - proxy.open(vhost, capabilities, insist); + proxy.open(virtualhost, capabilities, insist); } void ConnectionHandler::openOk(const framing::Array& /*knownHosts*/) |
