LocalService for service objects that are meant to be published. Should be not used directly unless you take care of taking the client lock.
More...
#include <LocalService.hpp>
|
| | LocalService (Client *client, std::string name, std::string type, uint16_t port, std::list< std::string > list, uint32_t ttl=0, bool publish=true) |
| |
| | LocalService (Client *client, AvahiIfIndex interf, AvahiProtocol prot, AvahiPublishFlags flags, std::string name, std::string type, std::string domain, uint16_t port, std::list< std::string > list, uint32_t ttl=0, bool publish=false) |
| |
| virtual | ~LocalService () |
| |
| int | publish () |
| |
| void | unpublish () |
| |
| bool | published () |
| |
| int | updateStringList (std::list< std::string > list) |
| |
| | Service (const Service &) |
| |
| | Service (Client *client, AvahiIfIndex interf, AvahiProtocol prot, std::string name, std::string type, std::string domain, uint16_t port=0, std::list< std::string > list=std::list< std::string >()) |
| |
| virtual | ~Service () |
| |
| bool | operator== (const Service &) |
| |
| uint16_t | getPort () const |
| |
| AvahiStringList * | getTxt () const |
| |
| std::list< std::string > | getStringList () const |
| |
| std::string | getName () const |
| |
| void | setConfiguration (const ServiceConfiguration &config) |
| |
| ServiceConfiguration | getConfiguration () const |
| |
| Client * | getClient () |
| |
LocalService for service objects that are meant to be published. Should be not used directly unless you take care of taking the client lock.
◆ LocalService() [1/2]
| servicediscovery::avahi::LocalService::LocalService |
( |
Client * |
client, |
|
|
std::string |
name, |
|
|
std::string |
type, |
|
|
uint16_t |
port, |
|
|
std::list< std::string > |
list, |
|
|
uint32_t |
ttl = 0, |
|
|
bool |
publish = true |
|
) |
| |
constructor
- Parameters
-
| client | the related AvahiClient instance |
| name | the name of the service |
| type | the type of the service: usually "_sometype._tcp" (must have a ._tcp or ._udp at the end for a protocol type) |
| port | the port number at which the service is present |
| list | a list of strings as additional information (TODO: avahi api supports map of strings, implement this functionality) |
| ttl | time to live of the service in case of network failure |
| publish | true if the related entry group is to be immediately commited |
◆ LocalService() [2/2]
| servicediscovery::avahi::LocalService::LocalService |
( |
Client * |
client, |
|
|
AvahiIfIndex |
interf, |
|
|
AvahiProtocol |
prot, |
|
|
AvahiPublishFlags |
flags, |
|
|
std::string |
name, |
|
|
std::string |
type, |
|
|
std::string |
domain, |
|
|
uint16_t |
port, |
|
|
std::list< std::string > |
list, |
|
|
uint32_t |
ttl = 0, |
|
|
bool |
publish = false |
|
) |
| |
constructor
- Parameters
-
| client | the related AvahiClient instance |
| interf | the network interface at which the service is to be published (above default is all interfaces) |
| prot | the protocol ipv4 or ipv6 (above default is unspecified) |
| flags | publish flags (above default is no flags) |
| name | the name of the service |
| type | the type of the service: usually "_sometype._tcp" (must have a ._tcp or ._udp at the end for a protocol type) |
| domain | domain of the service (above default is ".local") |
| port | the port number at which the service is present |
| list | a list of strings as additional information (TODO: avahi api supports map of strings, implement this functionality) |
| ttl | time to live of the service in case of network failure |
| publish | true if the related entry group is to be immediately commited |
◆ ~LocalService()
| servicediscovery::avahi::LocalService::~LocalService |
( |
| ) |
|
|
virtual |
◆ publish()
| int servicediscovery::avahi::LocalService::publish |
( |
| ) |
|
create and commit the related entry group
- Returns
- int 0 success (at least for commiting the entry group, also depends on the asynchronous message returned by avahi-daemon TODO: add a signal for this) -1 missing client -2 entry group pointer not null -3 cannot create entry group -4 failed to add the service to the entry group -5 failed to commit the entry group
◆ published()
| bool servicediscovery::avahi::LocalService::published |
( |
| ) |
|
Tests whether the local service is published or not
- Returns
- True when published, false when not
◆ unpublish()
| void servicediscovery::avahi::LocalService::unpublish |
( |
| ) |
|
opposite of publish. Unpublish a service.
◆ updateStringList()
| int servicediscovery::avahi::LocalService::updateStringList |
( |
std::list< std::string > |
list | ) |
|
update the service additional information
◆ ServiceDiscovery
The documentation for this class was generated from the following files:
- /build/rock-master-18.09-tools-service-discovery-0.20170710/src/impl/avahi/LocalService.hpp
- /build/rock-master-18.09-tools-service-discovery-0.20170710/src/impl/avahi/LocalService.cpp