examples: Do not use /localhost prefix in examples
This change is to avoid a common problem of running examples on separate
machines. The use of /localhost prefix, due to name-based scoping,
restricts the example programs to run on a single machine.
Change-Id: Id9f753fb7d097411b77b6227c6518679849d4411
diff --git a/examples/consumer-with-timer.cpp b/examples/consumer-with-timer.cpp
index 713e203..7897b41 100644
--- a/examples/consumer-with-timer.cpp
+++ b/examples/consumer-with-timer.cpp
@@ -52,7 +52,7 @@
{
std::cout << "One more Interest, delayed by the scheduler" << std::endl;
- Interest i(Name("/localhost/testApp/randomData"));
+ Interest i(Name("/example/testApp/randomData"));
i.setScope(1);
i.setInterestLifetime(time::milliseconds(1000));
i.setMustBeFresh(true);
@@ -69,7 +69,7 @@
// Explicitly create io_service object, which can be shared between Face and Scheduler
boost::asio::io_service ioService;
- Interest i(Name("/localhost/testApp/randomData"));
+ Interest i(Name("/example/testApp/randomData"));
i.setScope(1);
i.setInterestLifetime(time::seconds(1));
i.setMustBeFresh(true);
diff --git a/examples/consumer.cpp b/examples/consumer.cpp
index 3319065..6a76169 100644
--- a/examples/consumer.cpp
+++ b/examples/consumer.cpp
@@ -49,7 +49,7 @@
main(int argc, char** argv)
{
try {
- Interest i(Name("/localhost/testApp/randomData"));
+ Interest i(Name("/example/testApp/randomData"));
i.setScope(1);
i.setInterestLifetime(time::milliseconds(1000));
i.setMustBeFresh(true);
diff --git a/examples/producer.cpp b/examples/producer.cpp
index 2998bd0..3b5ff07 100644
--- a/examples/producer.cpp
+++ b/examples/producer.cpp
@@ -77,7 +77,7 @@
void
run()
{
- m_face.setInterestFilter("/localhost/testApp",
+ m_face.setInterestFilter("/example/testApp",
bind(&Producer::onInterest, this, _1, _2),
RegisterPrefixSuccessCallback(),
bind(&Producer::onRegisterFailed, this, _2));