summaryrefslogtreecommitdiff
path: root/cpp/lib/client
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2007-02-14 15:02:10 +0000
committerAlan Conway <aconway@apache.org>2007-02-14 15:02:10 +0000
commit8189a1f1f3d27d9ad7e0de50ed9e924e63d74aec (patch)
treef43ed248e99d67639f4330e604a0ed718f736d22 /cpp/lib/client
parent20a5f81e8bbf8d4429d55fffb47278e7ade81c17 (diff)
downloadqpid-python-8189a1f1f3d27d9ad7e0de50ed9e924e63d74aec.tar.gz
* cpp/lib/common/sys/ProducerConsumer.h:
General-purpose producer-consumer synchronization. Anywhere we have producer/consumer threads in qpid we should re-use this sync object rather than re-inventing the synchronization each time. * cpp/lib/common/sys/AtomicCount.h: Separated ScopedIncrement/ScopedDecrement into ScopedIncrement.h * cpp/tests/InProcessBroker.h: Added class InProcessBrokerClient, a self contained in-process client + broker convenience for tests. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/qpid.0-9@507560 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/lib/client')
-rw-r--r--cpp/lib/client/ClientChannel.cpp6
-rw-r--r--cpp/lib/client/ClientChannel.h8
2 files changed, 6 insertions, 8 deletions
diff --git a/cpp/lib/client/ClientChannel.cpp b/cpp/lib/client/ClientChannel.cpp
index 52910f5161..613469c4ba 100644
--- a/cpp/lib/client/ClientChannel.cpp
+++ b/cpp/lib/client/ClientChannel.cpp
@@ -54,11 +54,6 @@ AMQP_ServerProxy& Channel::brokerProxy() {
return *proxy;
}
-AMQMethodBody::shared_ptr Channel::brokerResponse() {
- // FIXME aconway 2007-02-08: implement responses.
- return AMQMethodBody::shared_ptr();
-}
-
void Channel::open(ChannelId id, Connection& con)
{
if (isOpen())
@@ -482,7 +477,6 @@ void Channel::close(
u_int16_t code, const std::string& text,
ClassId classId, MethodId methodId)
{
- // FIXME aconway 2007-01-26: Locking?
if (getId() != 0 && isOpen()) {
try {
sendAndReceive<ChannelCloseOkBody>(
diff --git a/cpp/lib/client/ClientChannel.h b/cpp/lib/client/ClientChannel.h
index 1c082f3b59..d6ec1d9772 100644
--- a/cpp/lib/client/ClientChannel.h
+++ b/cpp/lib/client/ClientChannel.h
@@ -44,6 +44,7 @@ namespace qpid {
namespace framing {
class ChannelCloseBody;
class AMQP_ServerProxy;
+class AMQMethodBody;
}
namespace client {
@@ -89,10 +90,13 @@ class Channel : public framing::ChannelAdapter,
u_int64_t lastDeliveryTag;
};
typedef std::map<std::string, Consumer> ConsumerMap;
+ typedef std::queue<boost::shared_ptr<framing::AMQMethodBody> > IncomingMethods;
+
static const std::string OK;
Connection* connection;
sys::Thread dispatcher;
+ IncomingMethods incomingMethods;
IncomingMessage* incoming;
ResponseHandler responses;
std::queue<IncomingMessage*> messages;//holds returned messages or those delivered for a consume
@@ -367,12 +371,12 @@ class Channel : public framing::ChannelAdapter,
* Returns a proxy for the "raw" AMQP broker protocol. Only for use by
* protocol experts.
*/
-
framing::AMQP_ServerProxy& brokerProxy();
+
/**
* Wait for the next method from the broker.
*/
- framing::AMQMethodBody::shared_ptr brokerResponse();
+ framing::AMQMethodBody::shared_ptr receive();
};
}}