summaryrefslogtreecommitdiff
path: root/cpp/examples/messaging
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2010-04-08 09:49:04 +0000
committerGordon Sim <gsim@apache.org>2010-04-08 09:49:04 +0000
commita62b3c4f125306ceec23175b9c7aef2786ee786c (patch)
treef7aeeba9df178aabc896a118464fc2044e53aa6a /cpp/examples/messaging
parentbe01dfd2d74634abf3387e8eb363d2c90b31cf0d (diff)
downloadqpid-python-a62b3c4f125306ceec23175b9c7aef2786ee786c.tar.gz
QPID-664: changed open() to connect(), moved url parameter to constructor, added detach() and isConnected()
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@931852 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/examples/messaging')
-rw-r--r--cpp/examples/messaging/client.cpp4
-rw-r--r--cpp/examples/messaging/drain.cpp4
-rw-r--r--cpp/examples/messaging/map_receiver.cpp4
-rw-r--r--cpp/examples/messaging/map_sender.cpp4
-rw-r--r--cpp/examples/messaging/queue_receiver.cpp4
-rw-r--r--cpp/examples/messaging/queue_sender.cpp4
-rw-r--r--cpp/examples/messaging/server.cpp4
-rw-r--r--cpp/examples/messaging/spout.cpp4
-rw-r--r--cpp/examples/messaging/topic_receiver.cpp4
-rw-r--r--cpp/examples/messaging/topic_sender.cpp4
10 files changed, 20 insertions, 20 deletions
diff --git a/cpp/examples/messaging/client.cpp b/cpp/examples/messaging/client.cpp
index 570497ca0b..c1a8d74237 100644
--- a/cpp/examples/messaging/client.cpp
+++ b/cpp/examples/messaging/client.cpp
@@ -39,9 +39,9 @@ using std::string;
int main(int argc, char** argv) {
const char* url = argc>1 ? argv[1] : "amqp:tcp:127.0.0.1:5672";
- Connection connection;
+ Connection connection(url);
try {
- connection.open(url);
+ connection.connect();
Session session = connection.createSession();
Sender sender = session.createSender("service_queue");
diff --git a/cpp/examples/messaging/drain.cpp b/cpp/examples/messaging/drain.cpp
index 1215ac75d2..41b9503649 100644
--- a/cpp/examples/messaging/drain.cpp
+++ b/cpp/examples/messaging/drain.cpp
@@ -93,9 +93,9 @@ int main(int argc, char** argv)
{
Options options(argv[0]);
if (options.parse(argc, argv)) {
- Connection connection(options.connectionOptions);
+ Connection connection(options.url, options.connectionOptions);
try {
- connection.open(options.url);
+ connection.connect();
Session session = connection.createSession();
Receiver receiver = session.createReceiver(options.address);
Duration timeout = options.getTimeout();
diff --git a/cpp/examples/messaging/map_receiver.cpp b/cpp/examples/messaging/map_receiver.cpp
index 7840a99fda..55c543b90b 100644
--- a/cpp/examples/messaging/map_receiver.cpp
+++ b/cpp/examples/messaging/map_receiver.cpp
@@ -38,9 +38,9 @@ using std::string;
int main(int argc, char** argv) {
const char* url = argc>1 ? argv[1] : "amqp:tcp:127.0.0.1:5672";
- Connection connection;
+ Connection connection(url);
try {
- connection.open(url);
+ connection.connect();
Session session = connection.createSession();
Receiver receiver = session.createReceiver("message_queue");
Variant::Map content;
diff --git a/cpp/examples/messaging/map_sender.cpp b/cpp/examples/messaging/map_sender.cpp
index 8dba47ce63..2e63c88aa4 100644
--- a/cpp/examples/messaging/map_sender.cpp
+++ b/cpp/examples/messaging/map_sender.cpp
@@ -37,9 +37,9 @@ using std::string;
int main(int argc, char** argv) {
const char* url = argc>1 ? argv[1] : "amqp:tcp:127.0.0.1:5672";
- Connection connection;
+ Connection connection(url);
try {
- connection.open(url);
+ connection.connect();
Session session = connection.createSession();
Sender sender = session.createSender("message_queue");
diff --git a/cpp/examples/messaging/queue_receiver.cpp b/cpp/examples/messaging/queue_receiver.cpp
index d7bcec1bb2..43dffd8baf 100644
--- a/cpp/examples/messaging/queue_receiver.cpp
+++ b/cpp/examples/messaging/queue_receiver.cpp
@@ -31,9 +31,9 @@ using namespace qpid::messaging;
int main(int argc, char** argv) {
const char* url = argc>1 ? argv[1] : "amqp:tcp:127.0.0.1:5672";
- Connection connection;
+ Connection connection(url);
try {
- connection.open(url);
+ connection.connect();
Session session = connection.createSession();
Receiver receiver = session.createReceiver("message_queue");
while (true) {
diff --git a/cpp/examples/messaging/queue_sender.cpp b/cpp/examples/messaging/queue_sender.cpp
index f7f0e9bf6d..fa355dbf88 100644
--- a/cpp/examples/messaging/queue_sender.cpp
+++ b/cpp/examples/messaging/queue_sender.cpp
@@ -34,9 +34,9 @@ int main(int argc, char** argv) {
const char* url = argc>1 ? argv[1] : "amqp:tcp:127.0.0.1:5672";
int count = argc>2 ? atoi(argv[2]) : 10;
- Connection connection;
+ Connection connection(url);
try {
- connection.open(url);
+ connection.connect();
Session session = connection.createSession();
Sender sender = session.createSender("message_queue");
diff --git a/cpp/examples/messaging/server.cpp b/cpp/examples/messaging/server.cpp
index 64dcc941ed..33d28a75c4 100644
--- a/cpp/examples/messaging/server.cpp
+++ b/cpp/examples/messaging/server.cpp
@@ -40,9 +40,9 @@ using std::string;
int main(int argc, char** argv) {
const char* url = argc>1 ? argv[1] : "amqp:tcp:127.0.0.1:5672";
- Connection connection;
+ Connection connection(url);
try {
- connection.open(url);
+ connection.connect();
Session session = connection.createSession();
Receiver receiver = session.createReceiver("service_queue; {create: always}");
diff --git a/cpp/examples/messaging/spout.cpp b/cpp/examples/messaging/spout.cpp
index 61b3f88711..9ed8b642c8 100644
--- a/cpp/examples/messaging/spout.cpp
+++ b/cpp/examples/messaging/spout.cpp
@@ -156,9 +156,9 @@ int main(int argc, char** argv)
{
Options options(argv[0]);
if (options.parse(argc, argv)) {
- Connection connection(options.connectionOptions);
+ Connection connection(options.url, options.connectionOptions);
try {
- connection.open(options.url);
+ connection.connect();
Session session = connection.createSession();
Sender sender = session.createSender(options.address);
diff --git a/cpp/examples/messaging/topic_receiver.cpp b/cpp/examples/messaging/topic_receiver.cpp
index df2484adfb..408920f5aa 100644
--- a/cpp/examples/messaging/topic_receiver.cpp
+++ b/cpp/examples/messaging/topic_receiver.cpp
@@ -33,9 +33,9 @@ int main(int argc, char** argv) {
const std::string url = argc>1 ? argv[1] : "amqp:tcp:127.0.0.1:5672";
const std::string pattern = argc>2 ? argv[2] : "#.#";
- Connection connection;
+ Connection connection(url);
try {
- connection.open(url);
+ connection.connect();
Session session = connection.createSession();
Receiver receiver = session.createReceiver("news_service; {filter:[control, " + pattern + "]}");
while (true) {
diff --git a/cpp/examples/messaging/topic_sender.cpp b/cpp/examples/messaging/topic_sender.cpp
index 5dd593ff8a..9d4cd582cf 100644
--- a/cpp/examples/messaging/topic_sender.cpp
+++ b/cpp/examples/messaging/topic_sender.cpp
@@ -51,9 +51,9 @@ int main(int argc, char** argv) {
const char* url = argc>1 ? argv[1] : "amqp:tcp:127.0.0.1:5672";
int count = argc>2 ? atoi(argv[2]) : 10;
- Connection connection;
+ Connection connection(url);
try {
- connection.open(url);
+ connection.connect();
Session session = connection.createSession();
Sender sender = session.createSender("news_service");