betabugs::networking::service_announcer Class Reference
#include <service_announcer.hpp>
Public Member Functions | |
service_announcer (boost::asio::io_service &io_service, const std::string &service_name, const unsigned short service_port, const unsigned short multicast_port=30001, const boost::asio::ip::address &multicast_address=boost::asio::ip::address::from_string("239.255.0.1")) | |
Detailed Description
class to announce a named network service, that can be discovered via the service_discoverer.
example:
boost::asio::io_service io_service;
service_announcer announcer(io_service, "my_awesome_service", 1337);
io_service.run();
Note: In case of error, this class just prints to std::cerr In case of an unknown service, this class prints it to std::clog
Constructor & Destructor Documentation
|
inline |
announce service named service_name listening on service_port in one second intervals. Note, that it is not required, that the service actually listens on service_port and that there is no coupling between the announcer and you service.
- Parameters
-
io_service io_service to use service_name the name of the announced service service_port the port where the service listens on multicast_port the port this udp multicast sender sends to multicast_address mulicast address to use. see: http://en.wikipedia.org/wiki/Multicast_address
The documentation for this class was generated from the following file: