summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2014-01-21 18:27:32 +0000
committerGordon Sim <gsim@apache.org>2014-01-21 18:27:32 +0000
commitdd4e49b082eae1ada283ea547a4e1371aa426d4c (patch)
tree03526cc1bc87fc2e7c339cf1882cb7be50242979 /cpp/src/qpid/messaging/amqp/ConnectionContext.cpp
parenta2cdb4e95a41c5baf2b0064070d7c1c218521f53 (diff)
downloadqpid-python-dd4e49b082eae1ada283ea547a4e1371aa426d4c.tar.gz
QPID-5497: implement Session::sync()
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1560125 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/messaging/amqp/ConnectionContext.cpp')
-rw-r--r--cpp/src/qpid/messaging/amqp/ConnectionContext.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp b/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp
index c9cdd075bc..b762ed036c 100644
--- a/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp
+++ b/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp
@@ -125,6 +125,17 @@ bool ConnectionContext::isOpen() const
return state == CONNECTED && pn_connection_state(connection) & (PN_LOCAL_ACTIVE | PN_REMOTE_ACTIVE);
}
+void ConnectionContext::sync(boost::shared_ptr<SessionContext> ssn)
+{
+ qpid::sys::ScopedLock<qpid::sys::Monitor> l(lock);
+ //wait for outstanding sends to settle
+ while (!ssn->settled()) {
+ QPID_LOG(debug, "Waiting for sends to settle on sync()");
+ wait(ssn);//wait until message has been confirmed
+ }
+ checkClosed(ssn);
+}
+
void ConnectionContext::endSession(boost::shared_ptr<SessionContext> ssn)
{
qpid::sys::ScopedLock<qpid::sys::Monitor> l(lock);