summaryrefslogtreecommitdiff
path: root/qpid/cpp/src/qmf/engine/ResilientConnection.cpp
diff options
context:
space:
mode:
authorTed Ross <tross@apache.org>2010-01-13 11:57:19 +0000
committerTed Ross <tross@apache.org>2010-01-13 11:57:19 +0000
commitfd64f22be60f12e03df8974b547cd9b3af331601 (patch)
treee2d9cafd894623102b5b1384d00af75db4dc88ff /qpid/cpp/src/qmf/engine/ResilientConnection.cpp
parent26280399738211de3f472b625091ff22c762538b (diff)
downloadqpid-python-fd64f22be60f12e03df8974b547cd9b3af331601.tar.gz
Added raise_event support to the Ruby and Python wrapped agent APIs.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@898727 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/qmf/engine/ResilientConnection.cpp')
-rw-r--r--qpid/cpp/src/qmf/engine/ResilientConnection.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/qpid/cpp/src/qmf/engine/ResilientConnection.cpp b/qpid/cpp/src/qmf/engine/ResilientConnection.cpp
index 53524fdbd8..9c19e4d460 100644
--- a/qpid/cpp/src/qmf/engine/ResilientConnection.cpp
+++ b/qpid/cpp/src/qmf/engine/ResilientConnection.cpp
@@ -39,6 +39,8 @@
#include <set>
#include <boost/intrusive_ptr.hpp>
#include <boost/noncopyable.hpp>
+#include <unistd.h>
+#include <fcntl.h>
using namespace std;
using namespace qmf::engine;
@@ -330,6 +332,10 @@ void ResilientConnectionImpl::unbind(SessionHandle handle,
void ResilientConnectionImpl::setNotifyFd(int fd)
{
notifyFd = fd;
+ if (notifyFd > 0) {
+ int original = fcntl(notifyFd, F_GETFL);
+ fcntl(notifyFd, F_SETFL, O_NONBLOCK | original);
+ }
}
void ResilientConnectionImpl::run()
@@ -403,13 +409,16 @@ void ResilientConnectionImpl::EnqueueEvent(ResilientConnectionEvent::EventKind k
const MessageImpl& message,
const string& errorText)
{
- Mutex::ScopedLock _lock(lock);
- ResilientConnectionEventImpl event(kind, message);
+ {
+ Mutex::ScopedLock _lock(lock);
+ ResilientConnectionEventImpl event(kind, message);
- event.sessionContext = sessionContext;
- event.errorText = errorText;
+ event.sessionContext = sessionContext;
+ event.errorText = errorText;
+
+ eventQueue.push_back(event);
+ }
- eventQueue.push_back(event);
if (notifyFd != -1)
{
int unused_ret; //Suppress warnings about ignoring return value.