32 #include <arpa/inet.h> 52 DNSServiceRefDeallocate(
fDNSRef);
64 Warning(
"ResolveBonjourRecord",
"resolve already in process");
68 DNSServiceErrorType err = DNSServiceResolve(&
fDNSRef, 0, 0,
74 if (err != kDNSServiceErr_NoError) {
75 Error(
"ResolveBonjourRecord",
"error in DNSServiceResolve (%d)", err);
81 Error(
"ResolveBonjourRecord",
"invalide sockfd");
98 args[0] = (
Long_t) hostInfo;
101 Emit(
"RecordResolved(TInetAddress*,Int_t)", args);
114 DNSServiceErrorType err = DNSServiceProcessResult(
fDNSRef);
115 if (err != kDNSServiceErr_NoError)
116 Error(
"BonjourSocketReadyRead",
"error in DNSServiceProcessResult");
124 DNSServiceErrorType errorCode,
const char *,
125 const char *hostTarget,
UShort_t port,
130 if (errorCode != kDNSServiceErr_NoError) {
131 ::Error(
"TBonjourResolver::BonjourResolveReply",
"error in BonjourResolveReply");
134 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.
virtual TInetAddress GetHostByName(const char *server)
Get Internet Protocol (IP) address of host.
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
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
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 * GetReplyDomain() const
TInetAddress fHostAddress
const char * GetServiceName() const
void Emit(const char *signal, const T &arg)
Activate signal with single parameter.
const char * GetRegisteredType() const
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.