From 771ac3e530a701120a933034f29659d16d5b4e85 Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Mon, 16 Nov 2009 17:30:23 +0000 Subject: QPID-664: Remove start()/stop() methods from api git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@880863 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/client/amqp0_10/ReceiverImpl.cpp | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) (limited to 'cpp/src/qpid/client/amqp0_10/ReceiverImpl.cpp') diff --git a/cpp/src/qpid/client/amqp0_10/ReceiverImpl.cpp b/cpp/src/qpid/client/amqp0_10/ReceiverImpl.cpp index 83b245aa02..fbaff7ec04 100644 --- a/cpp/src/qpid/client/amqp0_10/ReceiverImpl.cpp +++ b/cpp/src/qpid/client/amqp0_10/ReceiverImpl.cpp @@ -74,12 +74,16 @@ void ReceiverImpl::cancel() void ReceiverImpl::start() { - execute(); + if (state == STOPPED) { + state = STARTED; + startFlow(); + } } void ReceiverImpl::stop() { - execute(); + state = STOPPED; + session.messageStop(destination); } void ReceiverImpl::setCapacity(uint32_t c) @@ -103,14 +107,14 @@ void ReceiverImpl::init(qpid::client::AsyncSession s, AddressResolution& resolve session = s; if (state == UNRESOLVED) { source = resolver.resolveSource(session, address); - state = STOPPED;//TODO: if session is started, go straight to started + state = STARTED; } if (state == CANCELLED) { source->cancel(session, destination); parent.receiverCancelled(destination); } else { source->subscribe(session, destination); - if (state == STARTED) start(); + start(); } } @@ -171,20 +175,6 @@ void ReceiverImpl::cancelImpl() } } -void ReceiverImpl::startImpl() -{ - if (state == STOPPED) { - state = STARTED; - startFlow(); - } -} - -void ReceiverImpl::stopImpl() -{ - state = STOPPED; - session.messageStop(destination); -} - void ReceiverImpl::setCapacityImpl(uint32_t c) { if (c != capacity) { -- cgit v1.2.1