ArnLib
4.0.x
Active Registry Network
|
Browsing for ZeroConfig services. More...
#include <ArnZeroConf.hpp>
Public Slots | |
void | browse (bool enable=true) |
Change state of browsing. More... | |
void | stopBrowse () |
Stop browsing. More... | |
Signals | |
void | serviceChanged (bool isAdded, int id, const QString &serviceName, const QString &domain) |
Indicate service has been added / removed. More... | |
void | serviceAdded (int id, const QString &serviceName, const QString &domain) |
Indicate service has been added (discovered) More... | |
void | serviceRemoved (int id, const QString &serviceName, const QString &domain) |
Indicate service has been removed. More... | |
void | browseError (int errorCode) |
Indicate unsuccessfull browsing. More... | |
Public Member Functions | |
ArnZeroConfBrowser (QObject *parent=arnNullptr) | |
Standard constructor of an ArnZeroConfBrowser object. More... | |
ArnZeroConfBrowser (const QString &serviceType, QObject *parent=arnNullptr) | |
Constructor of an ArnZeroConfBrowser object. More... | |
virtual | ~ArnZeroConfBrowser () |
Destructor of an ArnZeroConfBrowser object. More... | |
void | setSubType (const QString &subtype) |
Set subtype (filter) More... | |
QString | subType () |
Return current subtype (filter) More... | |
QStringList | activeServiceNames () const |
Return current list of active service names. More... | |
int | serviceNameToId (const QString &name) |
Return the id for a service by its service name. More... | |
bool | isBrowsing () const |
Return the status of the browsing. More... | |
![]() | |
ArnZeroConfB (QObject *parent=arnNullptr) | |
virtual | ~ArnZeroConfB () |
QAbstractSocket::SocketType | socketType () const |
Returns the socket type for this Zero Config. More... | |
void | setSocketType (QAbstractSocket::SocketType type) |
Sets the socket type for this Zero Config. More... | |
QString | serviceType () const |
Returns the service type for this Zero Config. More... | |
void | setServiceType (const QString &type) |
Returns the service type for this Zero Config. More... | |
QString | domain () const |
Returns the domain for this Zero Config. More... | |
void | setDomain (const QString &domain) |
Sets the domain for this Zero Config. More... | |
ArnZeroConf::State | state () const |
Returns the current state of the service. More... | |
QString | fullServiceType () const |
Returns the full service type for this Zero Config. More... | |
Static Public Member Functions | |
static int | getNextId () |
Return the next id number for zero config objects. More... | |
Friends | |
class | ArnZeroConfIntern |
Browsing for ZeroConfig services.
This class handles browsing of ZeroConfig services.
Example usage
Definition at line 936 of file ArnZeroConf.hpp.
ArnZeroConfBrowser::ArnZeroConfBrowser | ( | QObject * | parent = arnNullptr | ) |
Standard constructor of an ArnZeroConfBrowser object.
All needed for browsing an "arn" service type.
[in] | parent |
Definition at line 897 of file ArnZeroConf.cpp.
ArnZeroConfBrowser::ArnZeroConfBrowser | ( | const QString & | serviceType, |
QObject * | parent = arnNullptr |
||
) |
Constructor of an ArnZeroConfBrowser object.
All needed parameters for browsing a service.
The service type can be a name or the standard format used by the Zeroconf specification, e.g. "_arn._tcp".
[in] | serviceType | the service type, e.g. "arn" or "_arn._tcp". |
[in] | parent |
Definition at line 904 of file ArnZeroConf.cpp.
|
virtual |
Destructor of an ArnZeroConfBrowser object.
If browsing is active, it will be stopped.
Definition at line 912 of file ArnZeroConf.cpp.
QStringList ArnZeroConfBrowser::activeServiceNames | ( | ) | const |
Return current list of active service names.
the | active service names |
Definition at line 922 of file ArnZeroConf.cpp.
|
slot |
Change state of browsing.
When browsing is started, services will be discovered.
[in] | enable | if true browsing is started, otherwise it is stopped |
Definition at line 954 of file ArnZeroConf.cpp.
|
signal |
|
inlinestatic |
Return the next id number for zero config objects.
Definition at line 1002 of file ArnZeroConf.hpp.
bool ArnZeroConfBrowser::isBrowsing | ( | ) | const |
Return the status of the browsing.
true | if browsing is started |
Definition at line 934 of file ArnZeroConf.cpp.
|
signal |
Indicate service has been added (discovered)
id will not be reused for any other service, it is unique within this program.
[in] | id | is the id number for the service |
[in] | serviceName | e.g. "My House Registry" |
[in] | domain | e.g. "local." |
|
signal |
Indicate service has been added / removed.
id will not be reused for any other service, it is unique within this program.
[in] | isAdded | is true when service has been added, otherwise false |
[in] | id | is the id number for the service |
[in] | serviceName | e.g. "My House Registry" |
[in] | domain | e.g. "local." |
int ArnZeroConfBrowser::serviceNameToId | ( | const QString & | name | ) |
Return the id for a service by its service name.
[in] | name | the service name, e.g. "My House Registry" |
Definition at line 928 of file ArnZeroConf.cpp.
|
signal |
Indicate service has been removed.
[in] | id | is the id number for the service |
[in] | serviceName | e.g. "My House Registry" |
[in] | domain | e.g. "local." |
void ArnZeroConfBrowser::setSubType | ( | const QString & | subtype | ) |
Set subtype (filter)
If passing empy subtype, this is taken as subtype (filter) disabled. When subtype (filter) is enabled, only services that have the same subtype is discovered.
[in] | subtype | the filter, e.g. "myGroup1" |
Definition at line 940 of file ArnZeroConf.cpp.
|
slot |
QString ArnZeroConfBrowser::subType | ( | ) |
Return current subtype (filter)
Empy subtype, is taken as subtype (filter) disabled.
Definition at line 946 of file ArnZeroConf.cpp.
|
friend |
Definition at line 938 of file ArnZeroConf.hpp.