qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r1406725 - in /qpid/trunk/qpid/cpp/bindings/qpid/dotnet: configure-windows.ps1 examples/csharp.map.callback.receiver/csharp.map.callback.receiver.cs src/Receiver.cpp
Date Wed, 07 Nov 2012 17:23:59 GMT
Author: chug
Date: Wed Nov  7 17:23:58 2012
New Revision: 1406725

URL: http://svn.apache.org/viewvc?rev=1406725&view=rev
Log:
QPID-4427 C++ Messaging Client .NET Binding failed to wrap receiver.close().
Also add exception handler to closing section of map callback receiver example.

Modified:
    qpid/trunk/qpid/cpp/bindings/qpid/dotnet/configure-windows.ps1
    qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.map.callback.receiver/csharp.map.callback.receiver.cs
    qpid/trunk/qpid/cpp/bindings/qpid/dotnet/src/Receiver.cpp

Modified: qpid/trunk/qpid/cpp/bindings/qpid/dotnet/configure-windows.ps1
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qpid/dotnet/configure-windows.ps1?rev=1406725&r1=1406724&r2=1406725&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qpid/dotnet/configure-windows.ps1 (original)
+++ qpid/trunk/qpid/cpp/bindings/qpid/dotnet/configure-windows.ps1 Wed Nov  7 17:23:58 2012
@@ -496,7 +496,7 @@ if ($make32) {
     $env:BOOST_ROOT = "$boost32"
     cd "$build32"
     Write-Host "Running 32-bit CMake in $build32 ..."
-    CMake -G "$global:cmakeGenerator" "-DCMAKE_INSTALL_PREFIX=install_x86" $cppDir
+    CMake -G "$global:cmakeGenerator" "-DGEN_DOXYGEN=No" "-DCMAKE_INSTALL_PREFIX=install_x86"
$cppDir
 } else {
     Write-Host "Skipped 32-bit CMake."
 }
@@ -508,7 +508,7 @@ if ($make64) {
     $env:BOOST_ROOT = "$boost64"
     cd "$build64"
     Write-Host "Running 64-bit CMake in $build64"
-    CMake -G "$global:cmakeGenerator Win64" "-DCMAKE_INSTALL_PREFIX=install_x64" $cppDir
+    CMake -G "$global:cmakeGenerator Win64" "-DGEN_DOXYGEN=No" "-DCMAKE_INSTALL_PREFIX=install_x64"
$cppDir
 } else {
     Write-Host "Skipped 64-bit CMake."
 }

Modified: qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.map.callback.receiver/csharp.map.callback.receiver.cs
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.map.callback.receiver/csharp.map.callback.receiver.cs?rev=1406725&r1=1406724&r2=1406725&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.map.callback.receiver/csharp.map.callback.receiver.cs
(original)
+++ qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.map.callback.receiver/csharp.map.callback.receiver.cs
Wed Nov  7 17:23:58 2012
@@ -162,6 +162,7 @@ namespace Org.Apache.Qpid.Messaging.Exam
         /// <param name="exception">The exception.</param>
         public void SessionException(Exception exception)
         {
+            // A typical application will take more action here.
             Console.WriteLine("{0} Exception caught.", exception.ToString());
         }
 
@@ -273,8 +274,17 @@ namespace Org.Apache.Qpid.Messaging.Exam
             //
             // 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;
         }
     }

Modified: qpid/trunk/qpid/cpp/bindings/qpid/dotnet/src/Receiver.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qpid/dotnet/src/Receiver.cpp?rev=1406725&r1=1406724&r2=1406725&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qpid/dotnet/src/Receiver.cpp (original)
+++ qpid/trunk/qpid/cpp/bindings/qpid/dotnet/src/Receiver.cpp Wed Nov  7 17:23:58 2012
@@ -344,9 +344,34 @@ namespace Messaging {
 
     void Receiver::Close()
     {
-        msclr::lock lk(privateLock);
-        ThrowIfDisposed();
+        System::Exception         ^ newException = nullptr;
+        Message                   ^ newMessage   = nullptr;
 
-        nativeObjPtr->close();
+        try
+        {
+			msclr::lock lk(privateLock);
+			ThrowIfDisposed();
+
+			nativeObjPtr->close();
+        }
+        catch (const ::qpid::types::Exception & error)
+        {
+            String ^ errmsg = gcnew String(error.what());
+            newException    = gcnew QpidException(errmsg);
+        }
+        finally
+        {
+            if (newException != nullptr)
+            {
+                if (newMessage != nullptr)
+                {
+                    delete newMessage;
+                }
+            }
+        }
+        if (newException != nullptr)
+        {
+            throw newException;
+        }
     }
 }}}}



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message