diff options
author | Kim van der Riet <kpvdr@apache.org> | 2013-02-28 16:14:30 +0000 |
---|---|---|
committer | Kim van der Riet <kpvdr@apache.org> | 2013-02-28 16:14:30 +0000 |
commit | 9c73ef7a5ac10acd6a50d5d52bd721fc2faa5919 (patch) | |
tree | 2a890e1df09e5b896a9b4168a7b22648f559a1f2 /cpp/bindings/qpid/dotnet/src/sessionreceiver/sessionreceiver.cs | |
parent | 172d9b2a16cfb817bbe632d050acba7e31401cd2 (diff) | |
download | qpid-python-asyncstore.tar.gz |
Update from trunk r1375509 through r1450773asyncstore
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/asyncstore@1451244 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/bindings/qpid/dotnet/src/sessionreceiver/sessionreceiver.cs')
-rw-r--r-- | cpp/bindings/qpid/dotnet/src/sessionreceiver/sessionreceiver.cs | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/cpp/bindings/qpid/dotnet/src/sessionreceiver/sessionreceiver.cs b/cpp/bindings/qpid/dotnet/src/sessionreceiver/sessionreceiver.cs index 680732068f..a15a8d60fe 100644 --- a/cpp/bindings/qpid/dotnet/src/sessionreceiver/sessionreceiver.cs +++ b/cpp/bindings/qpid/dotnet/src/sessionreceiver/sessionreceiver.cs @@ -37,6 +37,7 @@ namespace Org.Apache.Qpid.Messaging.SessionReceiver public interface ISessionReceiver
{
void SessionReceiver(Receiver receiver, Message message);
+ void SessionException(Exception exception);
}
@@ -67,25 +68,32 @@ namespace Org.Apache.Qpid.Messaging.SessionReceiver {
Receiver rcvr;
Message msg;
-
- keepRunning = true;
- while (keepRunning)
+ try
{
- rcvr = session.NextReceiver(DurationConstants.SECOND);
-
- if (null != rcvr)
+ keepRunning = true;
+ while (keepRunning)
{
- if (keepRunning)
+ rcvr = session.NextReceiver(DurationConstants.SECOND);
+
+ if (null != rcvr)
{
- msg = rcvr.Fetch(DurationConstants.SECOND);
- this.callback.SessionReceiver(rcvr, msg);
+ if (keepRunning)
+ {
+ msg = rcvr.Fetch(DurationConstants.SECOND);
+ this.callback.SessionReceiver(rcvr, msg);
+ }
}
+ //else
+ // receive timed out
+ // EventEngine exits the nextReceiver() function periodically
+ // in order to test the keepRunning flag
}
- //else
- // receive timed out
- // EventEngine exits the nextReceiver() function periodically
- // in order to test the keepRunning flag
}
+ catch (Exception e)
+ {
+ this.callback.SessionException(e);
+ }
+
// Private thread is now exiting.
}
|