From 9c73ef7a5ac10acd6a50d5d52bd721fc2faa5919 Mon Sep 17 00:00:00 2001 From: Kim van der Riet Date: Thu, 28 Feb 2013 16:14:30 +0000 Subject: Update from trunk r1375509 through r1450773 git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/asyncstore@1451244 13f79535-47bb-0310-9956-ffa450edef68 --- .../csharp.map.callback.receiver.cs | 28 ++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'cpp/bindings/qpid/dotnet/examples') diff --git a/cpp/bindings/qpid/dotnet/examples/csharp.map.callback.receiver/csharp.map.callback.receiver.cs b/cpp/bindings/qpid/dotnet/examples/csharp.map.callback.receiver/csharp.map.callback.receiver.cs index b1ba949e07..3bc22b2ce8 100644 --- a/cpp/bindings/qpid/dotnet/examples/csharp.map.callback.receiver/csharp.map.callback.receiver.cs +++ b/cpp/bindings/qpid/dotnet/examples/csharp.map.callback.receiver/csharp.map.callback.receiver.cs @@ -152,6 +152,21 @@ namespace Org.Apache.Qpid.Messaging.Examples } + /// + /// SessionReceiver implements the ISessionReceiver interface. + /// It is the exception function that receives all exception messages + /// It may be called any time server is running. + /// It is always called on server's private thread. + /// After this is called then the sessionReceiver and private thread are closed. + /// + /// The exception. + public void SessionException(Exception exception) + { + // A typical application will take more action here. + Console.WriteLine("{0} Exception caught.", exception.ToString()); + } + + /// /// Usage /// @@ -259,8 +274,17 @@ namespace Org.Apache.Qpid.Messaging.Examples // // Close the receiver and the connection. // - receiver.Close(); - connection.Close(); + try + { + receiver.Close(); + connection.Close(); + } + catch (Exception exception) + { + // receiver or connection may throw if they closed in error. + // A typical application will take more action here. + Console.WriteLine("{0} Closing exception caught.", exception.ToString()); + } return 0; } } -- cgit v1.2.1