From cc3755a16f00026af882ed14d122cc8aa6d50e82 Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Mon, 3 Aug 2009 11:30:13 +0200 Subject: renamed from zs to zmq --- examples/chat/Makefile.am | 6 +++--- examples/chat/chatroom.cpp | 12 ++++++------ examples/chat/display.cpp | 10 +++++----- examples/chat/prompt.cpp | 8 ++++---- 4 files changed, 18 insertions(+), 18 deletions(-) (limited to 'examples') diff --git a/examples/chat/Makefile.am b/examples/chat/Makefile.am index afdb827..84dad79 100644 --- a/examples/chat/Makefile.am +++ b/examples/chat/Makefile.am @@ -3,13 +3,13 @@ INCLUDES = -I$(top_builddir) -I$(top_builddir)/include noinst_PROGRAMS = chatroom display prompt chatroom_SOURCES = chatroom.cpp -chatroom_LDADD = $(top_builddir)/src/libzs.la +chatroom_LDADD = $(top_builddir)/src/libzmq.la chatroom_CXXFLAGS = -Wall -pedantic -Werror display_SOURCES = display.cpp -display_LDADD = $(top_builddir)/src/libzs.la +display_LDADD = $(top_builddir)/src/libzmq.la display_CXXFLAGS = -Wall -pedantic -Werror prompt_SOURCES = prompt.cpp -prompt_LDADD = $(top_builddir)/src/libzs.la +prompt_LDADD = $(top_builddir)/src/libzmq.la prompt_CXXFLAGS = -Wall -pedantic -Werror diff --git a/examples/chat/chatroom.cpp b/examples/chat/chatroom.cpp index f2240ab..4cf123a 100644 --- a/examples/chat/chatroom.cpp +++ b/examples/chat/chatroom.cpp @@ -23,7 +23,7 @@ using namespace std; -#include +#include int main (int argc, const char *argv []) { @@ -38,19 +38,19 @@ int main (int argc, const char *argv []) const char *out_interface = argv [2]; // Initialise 0MQ infrastructure - zs::context_t ctx (1, 1); + zmq::context_t ctx (1, 1); // Create two sockets. One for receiving messages from 'propmt' // applications, one for sending messages to 'display' applications - zs::socket_t in_socket (ctx, ZS_SUB); + zmq::socket_t in_socket (ctx, ZMQ_SUB); in_socket.bind (in_interface); - zs::socket_t out_socket (ctx, ZS_PUB); + zmq::socket_t out_socket (ctx, ZMQ_PUB); out_socket.bind (out_interface); while (true) { // Get a message - zs::message_t in_message; + zmq::message_t in_message; in_socket.recv (&in_message); // Get the current time. Replace the newline character at the end @@ -62,7 +62,7 @@ int main (int argc, const char *argv []) timebuf [strlen (timebuf) - 1] = ' '; // Create and fill in the message - zs::message_t out_message (strlen (timebuf) + in_message.size ()); + zmq::message_t out_message (strlen (timebuf) + in_message.size ()); char *data = (char*) out_message.data (); memcpy (data, timebuf, strlen (timebuf)); data += strlen (timebuf); diff --git a/examples/chat/display.cpp b/examples/chat/display.cpp index ceb096f..3da565e 100644 --- a/examples/chat/display.cpp +++ b/examples/chat/display.cpp @@ -23,7 +23,7 @@ using namespace std; -#include +#include int main (int argc, const char *argv []) { @@ -38,17 +38,17 @@ int main (int argc, const char *argv []) // Initialise 0MQ infrastructure, connect to the chatroom and ask for all // messages and gap notifications. - zs::context_t ctx (1, 1); - zs::socket_t s (ctx, ZS_SUB); + zmq::context_t ctx (1, 1); + zmq::socket_t s (ctx, ZMQ_SUB); s.connect (chatroom_out_address); s.subscribe ("*"); while (true) { // Get a message and print it to the console. - zs::message_t message; + zmq::message_t message; s.recv (&message); - if (message.type () == zs::message_gap) + if (message.type () == zmq::message_gap) cout << "Problems connecting to the chatroom..." << endl; else cout << (char*) message.data () << flush; diff --git a/examples/chat/prompt.cpp b/examples/chat/prompt.cpp index 461e7b8..66ceaf4 100644 --- a/examples/chat/prompt.cpp +++ b/examples/chat/prompt.cpp @@ -23,7 +23,7 @@ using namespace std; -#include +#include int main (int argc, const char *argv []) { @@ -38,8 +38,8 @@ int main (int argc, const char *argv []) const char *user_name = argv [2]; // Initialise 0MQ infrastructure and connect to the chatroom. - zs::context_t ctx (1, 1); - zs::socket_t s (ctx, ZS_PUB); + zmq::context_t ctx (1, 1); + zmq::socket_t s (ctx, ZMQ_PUB); s.connect (chatroom_in_address); while (true) { @@ -52,7 +52,7 @@ int main (int argc, const char *argv []) text = text + ": " + textbuf; // Create the message (terminating zero is part of the message) - zs::message_t message (text.size () + 1); + zmq::message_t message (text.size () + 1); memcpy (message.data (), text.c_str (), text.size () + 1); // Send the message -- cgit v1.2.3