18 #include <zeroconf_msgs/PublishedService.h> 25 int main(
int argc,
char **argv) {
28 zeroconf_msgs::PublishedService service_dudette, service_dude, service_colliding_dude, service_not_advertised;
29 service_dudette.name =
"Dudette";
30 service_dudette.type =
"_ros-master._tcp";
31 service_dudette.port = 8888;
32 service_dudette.domain =
"local";
33 ROS_INFO(
"===== Adding a service =====");
36 ROS_INFO(
"===== Adding a listener =====");
39 service_dude = service_dudette;
40 service_dude.name =
"Dude";
41 service_dude.port = 8889;
42 ROS_INFO(
"===== Adding another service =====");
45 ROS_INFO(
"===== Accidentally adding the service again =====");
48 service_colliding_dude = service_dude;
50 ROS_INFO(
"===== Local Collision =====");
51 service_colliding_dude.port = 8890;
54 ROS_INFO(
"===== Removing some services =====");
57 service_not_advertised = service_dude;
58 service_not_advertised.name =
"OtherDude";
59 ROS_INFO(
"===== Remove a non-advertised service =====");
61 ROS_INFO(
"===== Waiting for listener to detect removals =====");
63 ROS_INFO(
"===== Remove a listener =====");
bool add_listener(std::string &service_type)
bool add_service(PublishedService &service)
bool remove_service(const PublishedService &service)
int main(int argc, char **argv)
bool remove_listener(const std::string &service_type)