diff options
| author | Alan Conway <aconway@apache.org> | 2007-01-15 21:56:23 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2007-01-15 21:56:23 +0000 |
| commit | ef1469a7ea1f54f266aee8f2899b7cd0c7e07d08 (patch) | |
| tree | 3b69ec6c589ff8edd628f2e218589180cbca005b /cpp/lib/client/Connection.cpp | |
| parent | 5aaad510dc978dc09f92c774c81255b7af6b8b68 (diff) | |
| download | qpid-python-ef1469a7ea1f54f266aee8f2899b7cd0c7e07d08.tar.gz | |
* Client & broker using Requester/Responder to manage request/response IDs.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/qpid.0-9@496511 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/lib/client/Connection.cpp')
| -rw-r--r-- | cpp/lib/client/Connection.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/cpp/lib/client/Connection.cpp b/cpp/lib/client/Connection.cpp index ad8aa1d0dd..10a0b50aad 100644 --- a/cpp/lib/client/Connection.cpp +++ b/cpp/lib/client/Connection.cpp @@ -32,10 +32,14 @@ using namespace qpid::sys; u_int16_t Connection::channelIdCounter; -Connection::Connection( bool debug, u_int32_t _max_frame_size, qpid::framing::ProtocolVersion* _version) : max_frame_size(_max_frame_size), closed(true), +Connection::Connection( + bool debug, u_int32_t _max_frame_size, + qpid::framing::ProtocolVersion* _version +) : max_frame_size(_max_frame_size), closed(true), version(_version->getMajor(),_version->getMinor()) { - connector = new Connector(version, debug, _max_frame_size); + connector = new Connector( + version, requester, responder, debug, _max_frame_size); } Connection::~Connection(){ @@ -152,6 +156,16 @@ void Connection::removeChannel(Channel* channel){ } void Connection::received(AMQFrame* frame){ + AMQBody::shared_ptr body = frame->getBody(); + u_int8_t type = body->type(); + if (type == REQUEST_BODY) + responder.received(AMQRequestBody::getData(body)); + handleFrame(frame); + if (type == RESPONSE_BODY) + requester.processed(AMQResponseBody::getData(body)); +} + +void Connection::handleFrame(AMQFrame* frame){ u_int16_t channelId = frame->getChannel(); if(channelId == 0){ |
