summaryrefslogtreecommitdiff
path: root/cpp/bindings/qpid/dotnet/examples/csharp.example.client
diff options
context:
space:
mode:
authorCharles E. Rolke <chug@apache.org>2010-12-01 19:54:13 +0000
committerCharles E. Rolke <chug@apache.org>2010-12-01 19:54:13 +0000
commita3ec0c3d16162606321c7f89e4ef78bccd0a12a0 (patch)
tree32954a6a92d7a1d9a984020bbd55100d283619aa /cpp/bindings/qpid/dotnet/examples/csharp.example.client
parente5ddc402681322fc0031b3d2bc39b1d75e8a1080 (diff)
downloadqpid-python-a3ec0c3d16162606321c7f89e4ef78bccd0a12a0.tar.gz
Bring QPID .NET Binding examples more in line with cpp examples.
1. Return 0/1 from main to indicate success/failure, where possible. 2. Call sender's session.Sync() after transmitting messages and not waiting for responses. 3. Add third arg connectionOptions as used in cpp examples. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1041141 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/bindings/qpid/dotnet/examples/csharp.example.client')
-rw-r--r--cpp/bindings/qpid/dotnet/examples/csharp.example.client/csharp.example.client.cs9
1 files changed, 7 insertions, 2 deletions
diff --git a/cpp/bindings/qpid/dotnet/examples/csharp.example.client/csharp.example.client.cs b/cpp/bindings/qpid/dotnet/examples/csharp.example.client/csharp.example.client.cs
index 79b798e540..19a5267297 100644
--- a/cpp/bindings/qpid/dotnet/examples/csharp.example.client/csharp.example.client.cs
+++ b/cpp/bindings/qpid/dotnet/examples/csharp.example.client/csharp.example.client.cs
@@ -24,13 +24,16 @@ using Org.Apache.Qpid.Messaging;
namespace Org.Apache.Qpid.Messaging.Examples {
class Client {
- static void Main(string[] args) {
+ static int Main(string[] args) {
String url = "amqp:tcp:127.0.0.1:5672";
+ String connectionOptions = "";
if (args.Length > 0)
url = args[0];
+ if (args.Length > 1)
+ connectionOptions = args[1];
- Connection connection = new Connection(url);
+ Connection connection = new Connection(url, connectionOptions);
try
{
connection.Open();
@@ -59,12 +62,14 @@ namespace Org.Apache.Qpid.Messaging.Examples {
Console.WriteLine("{0} -> {1}", request.GetContent(), response.GetContent());
}
connection.Close();
+ return 0;
}
catch (Exception e)
{
Console.WriteLine("Exception {0}.", e);
connection.Close();
}
+ return 1;
}
}
}