ArnLib
4.0.x
Active Registry Network
|
Resolv a ZeroConfig service. More...
#include <ArnZeroConf.hpp>
Signals | |
void | resolved (int id, const QByteArray &escFullDomain) |
Indicate successfull resolve of service. More... | |
void | resolveError (int id, int code) |
Indicate unsuccessfull resolve of service. More... | |
Public Member Functions | |
ArnZeroConfResolve (QObject *parent=arnNullptr) | |
Standard constructor of an ArnZeroConfResolv object. More... | |
ArnZeroConfResolve (const QString &serviceName, QObject *parent=arnNullptr) | |
Constructor of an ArnZeroConfResolv object. More... | |
ArnZeroConfResolve (const QString &serviceName, const QString &serviceType, QObject *parent=arnNullptr) | |
Constructor of an ArnZeroConfResolv object. More... | |
virtual | ~ArnZeroConfResolve () |
Destructor of an ArnZeroConfResolv object. More... | |
int | id () const |
Returns the id number for this resolv. More... | |
void | setId (int id) |
Sets the id number for this this resolv. More... | |
QString | host () const |
Returns the host name for this resolv. More... | |
quint16 | port () const |
Returns the port number for connecting to the service. More... | |
QString | serviceName () const |
Returns the service name used for this resolv. More... | |
void | setServiceName (const QString &name) |
Set the service name used for this resolv. More... | |
bool | getTxtRecordMap (Arn::XStringMap &xsm) |
Load a XStringMap with parameters from the Txt Record. More... | |
QByteArray | txtRecord () const |
Return the Txt Record for this Zero Config. More... | |
void | resolve (bool forceMulticast=false) |
Resolve the service. More... | |
void | releaseResolve () |
Release the resolving. 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... | |
Friends | |
class | ArnZeroConfIntern |
Resolv a ZeroConfig service.
This class handles resolving of a ZeroConfig service. The service name can be given directly if known, but typically it comes from ArnZeroConfBrowser.
Example usage
Definition at line 616 of file ArnZeroConf.hpp.
ArnZeroConfResolve::ArnZeroConfResolve | ( | QObject * | parent = arnNullptr | ) |
Standard constructor of an ArnZeroConfResolv object.
[in] | parent |
Definition at line 528 of file ArnZeroConf.cpp.
ArnZeroConfResolve::ArnZeroConfResolve | ( | const QString & | serviceName, |
QObject * | parent = arnNullptr |
||
) |
Constructor of an ArnZeroConfResolv object.
All needed parameters for an "arn" service type.
[in] | serviceName | the human readable naming of the service, e.g. "My fantastic service". |
[in] | parent |
Definition at line 535 of file ArnZeroConf.cpp.
ArnZeroConfResolve::ArnZeroConfResolve | ( | const QString & | serviceName, |
const QString & | serviceType, | ||
QObject * | parent = arnNullptr |
||
) |
Constructor of an ArnZeroConfResolv object.
All needed parameters for a service.
The service type can be a name or the standard format used by the Zeroconf specification, e.g. "_arn._tcp".
[in] | serviceName | the human readable naming of the service, e.g. "My fantastic service". |
[in] | serviceType | the service type, e.g. "arn" or "_arn._tcp". |
[in] | parent |
Definition at line 544 of file ArnZeroConf.cpp.
|
virtual |
Destructor of an ArnZeroConfResolv object.
If the service is registered, it will be unregistered.
Definition at line 555 of file ArnZeroConf.cpp.
|
inline |
Load a XStringMap with parameters from the Txt Record.
It is assumed that the Txt Record has already been received.
After loading XStringMap is successfull it contains the parameters from the Txt Record, e.g. Arn::XStringMap::toXString() can return "protovers=1.0 MyParam=xyz".
[out] | xsm | is the loaded XStringMap if successfull, otherwise undefined. |
true | if successfull. |
Definition at line 703 of file ArnZeroConf.hpp.
|
inline |
Returns the host name for this resolv.
Hostname contain domain, e.g. "myserver.local".
Definition at line 670 of file ArnZeroConf.hpp.
int ArnZeroConfResolve::id | ( | ) | const |
Returns the id number for this resolv.
Definition at line 565 of file ArnZeroConf.cpp.
|
inline |
Returns the port number for connecting to the service.
the | port number |
Definition at line 676 of file ArnZeroConf.hpp.
void ArnZeroConfResolve::releaseResolve | ( | ) |
Release the resolving.
Any resolve attempts in progress will be aborted.
Definition at line 615 of file ArnZeroConf.cpp.
void ArnZeroConfResolve::resolve | ( | bool | forceMulticast = false | ) |
Resolve the service.
Tries to resolve the service to determine the host and port necessary to establish a connection.
Result is indicated by resolved() and resolveError() signals.
[in] | forceMulticast | when true, ArnZeroConfResolv will use a multicast request to resolve the service, even if the host name is a unicast address, i.e. outside the local network. |
Definition at line 577 of file ArnZeroConf.cpp.
|
signal |
Indicate successfull resolve of service.
[in] | id | is the id number for this resolve |
[in] | escFullDomain | is the raw full domain with esc sequences |
|
signal |
Indicate unsuccessfull resolve of service.
[in] | id | is the id number for this resolve |
[in] | code | is the error code. |
|
inline |
Returns the service name used for this resolv.
Definition at line 682 of file ArnZeroConf.hpp.
void ArnZeroConfResolve::setId | ( | int | id | ) |
Sets the id number for this this resolv.
This id can be used to identify different resolves when using a common handler.
When not set, it will be automatically assigned during resolve().
[in] | id | the id number |
Definition at line 571 of file ArnZeroConf.cpp.
|
inline |
Set the service name used for this resolv.
Service names can be any human readable id. It will be used when reolving the service.
[in] | name | is service name, e.g. "My House Registry" |
Definition at line 691 of file ArnZeroConf.hpp.
|
inline |
Return the Txt Record for this Zero Config.
It is assumed that the Txt Record has already been received.
The binary format should be the standardized from the Zeroconfig specification.
Definition at line 713 of file ArnZeroConf.hpp.
|
friend |
Definition at line 618 of file ArnZeroConf.hpp.