summaryrefslogtreecommitdiff
path: root/cpp/bindings/qpid/dotnet/examples/csharp.direct.sender/csharp.direct.sender.cs
diff options
context:
space:
mode:
authorTed Ross <tross@apache.org>2010-05-10 20:33:19 +0000
committerTed Ross <tross@apache.org>2010-05-10 20:33:19 +0000
commit054094d1d805e5812e7c7c3a534515f57ea1c606 (patch)
tree8e8f2de1ac885232e46b7f3f40d2f5dd894c4a22 /cpp/bindings/qpid/dotnet/examples/csharp.direct.sender/csharp.direct.sender.cs
parentfe64caba89452ef43cc872c7f15faa655cc8a7da (diff)
downloadqpid-python-054094d1d805e5812e7c7c3a534515f57ea1c606.tar.gz
QPID-2589 - Applied patch from Chuck Rolke.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@942892 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/bindings/qpid/dotnet/examples/csharp.direct.sender/csharp.direct.sender.cs')
-rw-r--r--cpp/bindings/qpid/dotnet/examples/csharp.direct.sender/csharp.direct.sender.cs42
1 files changed, 42 insertions, 0 deletions
diff --git a/cpp/bindings/qpid/dotnet/examples/csharp.direct.sender/csharp.direct.sender.cs b/cpp/bindings/qpid/dotnet/examples/csharp.direct.sender/csharp.direct.sender.cs
new file mode 100644
index 0000000000..3ad6c58a2c
--- /dev/null
+++ b/cpp/bindings/qpid/dotnet/examples/csharp.direct.sender/csharp.direct.sender.cs
@@ -0,0 +1,42 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using org.apache.qpid.messaging;
+
+namespace csharp.direct.sender
+{
+ class Program
+ {
+ static void Main(string[] args)
+ {
+ String host = "localhost:5672";
+ String addr = "amq.direct/key";
+ int nMsg = 10;
+
+ Connection conn = new Connection(host);
+
+ conn.open();
+
+ if (!conn.isOpen())
+ {
+ Console.WriteLine("Failed to open connection to host : {0}", host);
+ }
+ else
+ {
+ Session sess = conn.createSession();
+
+ Sender snd = sess.createSender(addr);
+
+ for (int i = 0; i < nMsg; i++)
+ {
+ Message msg = new Message(String.Format("Test Message {0}", i));
+
+ snd.send(msg);
+ }
+
+ conn.close();
+ }
+ }
+ }
+}