From 00e14b01033ae8c33399bc6ebfd28930498b2533 Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Wed, 7 Apr 2010 19:41:44 +0000 Subject: QPID-664: removed flush, added option to make sync non-blocking if so desired git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@931651 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/client/amqp0_10/SessionImpl.cpp | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) (limited to 'cpp/src/qpid/client/amqp0_10/SessionImpl.cpp') diff --git a/cpp/src/qpid/client/amqp0_10/SessionImpl.cpp b/cpp/src/qpid/client/amqp0_10/SessionImpl.cpp index 9efafb1d16..8f9751a967 100644 --- a/cpp/src/qpid/client/amqp0_10/SessionImpl.cpp +++ b/cpp/src/qpid/client/amqp0_10/SessionImpl.cpp @@ -51,14 +51,10 @@ namespace amqp0_10 { SessionImpl::SessionImpl(ConnectionImpl& c, bool t) : connection(&c), transactional(t) {} -void SessionImpl::sync() +void SessionImpl::sync(bool block) { - retry(); -} - -void SessionImpl::flush() -{ - retry(); + if (block) retry(); + else execute(); } void SessionImpl::commit() @@ -82,7 +78,7 @@ void SessionImpl::acknowledge(bool sync_) //message may be redelivered; i.e. the application cannot delete //any state necessary for preventing reprocessing of the message execute(); - if (sync_) sync(); + if (sync_) sync(true); } void SessionImpl::reject(qpid::messaging::Message& m) @@ -378,17 +374,12 @@ uint32_t SessionImpl::pendingAckImpl(const std::string* destination) } } -void SessionImpl::syncImpl() -{ - session.sync(); -} - -void SessionImpl::flushImpl() +void SessionImpl::syncImpl(bool block) { - session.flush(); + if (block) session.sync(); + else session.sendSyncRequest(); } - void SessionImpl::commitImpl() { incoming.accept(); -- cgit v1.2.1