31 #include <arpa/inet.h>
51 DNSServiceRefDeallocate(
fDNSRef);
63 Warning(
"ResolveBonjourRecord",
"resolve already in process");
67 DNSServiceErrorType err = DNSServiceResolve(&
fDNSRef, 0, 0,
73 if (err != kDNSServiceErr_NoError) {
74 Error(
"ResolveBonjourRecord",
"error in DNSServiceResolve (%d)", err);
80 Error(
"ResolveBonjourRecord",
"invalide sockfd");
97 args[0] = (
Long_t) hostInfo;
100 Emit(
"RecordResolved(TInetAddress*,Int_t)", args);
113 DNSServiceErrorType err = DNSServiceProcessResult(
fDNSRef);
114 if (err != kDNSServiceErr_NoError)
115 Error(
"BonjourSocketReadyRead",
"error in DNSServiceProcessResult");
123 DNSServiceErrorType errorCode,
const char *,
124 const char *hostTarget,
UShort_t port,
129 if (errorCode != kDNSServiceErr_NoError) {
130 ::Error(
"TBonjourResolver::BonjourResolveReply",
"error in BonjourResolveReply");
133 resolver->
fPort = ntohs(port);
void BonjourSocketReadyRead()
The Bonjour socket is ready for reading.
Int_t ResolveBonjourRecord(const TBonjourRecord &record)
Resolve Bonjour service to IP address and port.
This class represents an Internet Protocol (IP) address.
virtual void Add()
Add file event handler to system file handler list.
void RecordResolved(const TInetAddress *hostInfo, Int_t port)
Emit RecordResolved signal.
const char * GetServiceName() const
ClassImp(TBonjourResolver) TBonjourResolver
Default ctor.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual TInetAddress GetHostByName(const char *server)
Get Internet Protocol (IP) address of host.
void Emit(const char *signal)
Acitvate signal without args.
virtual ~TBonjourResolver()
Cleanup.
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
Non-static method is used to connect from the signal of this object to the receiver slot...
R__EXTERN TSystem * gSystem
const char * GetReplyDomain() const
static void DNSSD_API BonjourResolveReply(DNSServiceRef, DNSServiceFlags, UInt_t, DNSServiceErrorType, const char *, const char *, UShort_t, UShort_t, const char *, void *)
Static Bonjour resolver callback function.
TFileHandler * fBonjourSocketHandler
const char * GetRegisteredType() const
TInetAddress fHostAddress
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.