Allows to publish an avahi service to the network. More...
Header: | #include <QtAvahiService> |
Inherits: |
enum | QtAvahiServiceState { QtAvahiServiceStateUncomitted, QtAvahiServiceStateRegistering, QtAvahiServiceStateEstablished, QtAvahiServiceStateCollision, QtAvahiServiceStateFailure } |
QtAvahiService(QObject * parent = nullptr) | |
~QtAvahiService() | |
QString | errorString() const |
QHostAddress | hostAddress() const |
bool | isValid() const |
QString | name() const |
quint16 | port() const |
bool | registerService(const QString & name, const QHostAddress & hostAddress, const quint16 & port, const QString & serviceType = "_http._tcp", const QHash<QString, QString> & txtRecords = QHash<QString, QString) |
void | resetService(bool silent = false) |
QString | serviceType() const |
QtAvahiServiceState | state() const |
QHash<QString, QString> | txtRecords() const |
bool | updateTxtRecord(const QHash<QString, QString> & txtRecords) |
void | serviceStateChanged(const QtAvahiServiceState & state) |
Allows to publish an avahi service to the network.
This enum type specifies the state of a QtAvahiService.
Constant | Value | Description |
---|---|---|
nymeaserver::QtAvahiService::QtAvahiServiceStateUncomitted | ? | The group has not yet been committed, the user must still call avahi_entry_group_commit(). |
nymeaserver::QtAvahiService::QtAvahiServiceStateRegistering | 1 | The entries of the group are currently being registered. |
nymeaserver::QtAvahiService::QtAvahiServiceStateEstablished | 2 | The entries have successfully been established. |
nymeaserver::QtAvahiService::QtAvahiServiceStateCollision | 3 | A name collision for one of the entries in the group has been detected, the entries have been withdrawn. |
nymeaserver::QtAvahiService::QtAvahiServiceStateFailure | 4 | Some kind of failure happened, the entries have been withdrawn. |
Constructs a new QtAvahiService with the given parent.
Destructs this QtAvahiService.
Returns the error string of this QtAvahiService.
Returns the hostAddress of this QtAvahiService.
Returns true if the service group was added and committed to the network without errors.
Returns the name of this QtAvahiService.
Returns the port of this QtAvahiService.
Remove this service from the local network. This QtAvahiService can be reused to register a new avahi service.
[signal]
void QtAvahiService::serviceStateChanged(const QtAvahiServiceState & state)This signal will be emitted when the state of this QtAvahiService has changed.
Returns the service type of this QtAvahiService.
Update the TXT record of this service. Returns true of the record could be updated.