using namespace std;
-int main(int argc, char *argv[]) {
+int main() {
// Open a new meshlink instance.
meshlink::mesh mesh;
// Check that our own node exists.
- meshlink::node *self = mesh.get_node("foo");
+ meshlink::node *self = mesh.get_self();
if(!self) {
cerr << "Foo does not know about itself\n";
return 1;
return 1;
}
+ // Disable local discovery.
+
+ mesh.enable_discovery(false);
+
// Start and stop the mesh.
if(!mesh.start()) {
return 1;
}
- self = mesh.get_node("foo");
+ self = mesh.get_self();
if(!self) {
cerr << "Foo doesn't know about itself the second time\n";
return 1;
// Start and stop the mesh.
+ mesh.enable_discovery(false);
+
if(!mesh.start()) {
cerr << "Foo could not start a third time\n";
return 1;