diff options
Diffstat (limited to 'qpid/cpp')
| -rw-r--r-- | qpid/cpp/bindings/qpid/dotnet/src/Connection.cpp | 50 | ||||
| -rw-r--r-- | qpid/cpp/bindings/qpid/dotnet/src/Connection.h | 14 |
2 files changed, 64 insertions, 0 deletions
diff --git a/qpid/cpp/bindings/qpid/dotnet/src/Connection.cpp b/qpid/cpp/bindings/qpid/dotnet/src/Connection.cpp index 9171b5e9fc..d4d5d2fd4f 100644 --- a/qpid/cpp/bindings/qpid/dotnet/src/Connection.cpp +++ b/qpid/cpp/bindings/qpid/dotnet/src/Connection.cpp @@ -267,6 +267,56 @@ namespace Messaging { }
}
+
+ void Connection::Reconnect(System::String ^ url)
+ {
+ System::Exception ^ newException = nullptr;
+
+ try
+ {
+ msclr::lock lk(privateLock);
+ ThrowIfDisposed();
+
+ std::string nativeUrl = QpidMarshal::ToNative(url);
+ nativeObjPtr->reconnect(nativeUrl);
+ }
+ catch (const ::qpid::types::Exception & error)
+ {
+ String ^ errmsg = gcnew String(error.what());
+ newException = gcnew QpidException(errmsg);
+ }
+
+ if (newException != nullptr)
+ {
+ throw newException;
+ }
+ }
+
+
+ void Connection::Reconnect()
+ {
+ System::Exception ^ newException = nullptr;
+
+ try
+ {
+ msclr::lock lk(privateLock);
+ ThrowIfDisposed();
+
+ nativeObjPtr->reconnect();
+ }
+ catch (const ::qpid::types::Exception & error)
+ {
+ String ^ errmsg = gcnew String(error.what());
+ newException = gcnew QpidException(errmsg);
+ }
+
+ if (newException != nullptr)
+ {
+ throw newException;
+ }
+ }
+
+
//
// CreateTransactionalSession()
//
diff --git a/qpid/cpp/bindings/qpid/dotnet/src/Connection.h b/qpid/cpp/bindings/qpid/dotnet/src/Connection.h index 27381d8d5e..82b5262084 100644 --- a/qpid/cpp/bindings/qpid/dotnet/src/Connection.h +++ b/qpid/cpp/bindings/qpid/dotnet/src/Connection.h @@ -129,6 +129,20 @@ namespace Messaging { }
}
+ void Reconnect(System::String ^ url);
+ void Reconnect();
+
+ property System::String ^ Url
+ {
+ System::String ^ get()
+ {
+ msclr::lock lk(privateLock);
+ ThrowIfDisposed();
+
+ return gcnew System::String(nativeObjPtr->getUrl().c_str());
+ }
+ }
+
// CreateTransactionalSession()
Session ^ CreateTransactionalSession();
Session ^ CreateTransactionalSession(System::String ^ name);
|
