38 #include <arpa/inet.h>
60 DNSServiceRefDeallocate(
fDNSRef);
72 Warning(
"RegisterService",
"already registered a service");
79 DNSServiceErrorType err = DNSServiceRegister(&
fDNSRef, 0, kDNSServiceInterfaceIndexAny,
91 if (err != kDNSServiceErr_NoError) {
92 Error(
"RegisterService",
"error in DNSServiceRegister (%d)", err);
98 Error(
"RegisterService",
"invalid sockfd");
114 Emit(
"ServiceRegistered(TBonjourRecord*)", (
Long_t)record);
124 DNSServiceErrorType err = DNSServiceProcessResult(
fDNSRef);
125 if (err != kDNSServiceErr_NoError)
126 Error(
"BonjourSocketReadyRead",
"error in DNSServiceProcessResult");
133 DNSServiceErrorType errCode,
134 const char *
name,
const char *regType,
135 const char *domain,
void *context)
138 if (errCode != kDNSServiceErr_NoError) {
139 ::Error(
"TBonjourRegistrar::BonjourRegisterService",
"error in BonjourRegisterService");
ClassImp(TBonjourRegistrar) TBonjourRegistrar
Default ctor.
Int_t RegisterService(const TBonjourRecord &record, UShort_t servicePort)
Register Bonjour service.
TFileHandler * fBonjourSocketHandler
virtual void Add()
Add file event handler to system file handler list.
const char * GetTXTRecords() const
const char * GetServiceName() const
void BonjourSocketReadyRead()
The Bonjour socket is ready for reading.
virtual ~TBonjourRegistrar()
Cleanup.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
void Emit(const char *signal)
Acitvate signal without args.
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...
virtual void Setenv(const char *name, const char *value)
Set environment variable.
R__EXTERN TSystem * gSystem
const char * GetReplyDomain() const
Int_t GetTXTRecordsLength() const
TBonjourRecord fFinalRecord
const char * GetRegisteredType() const
static void DNSSD_API BonjourRegisterService(DNSServiceRef, DNSServiceFlags, DNSServiceErrorType, const char *, const char *, const char *, void *)
Static Bonjour register callback function.
void ServiceRegistered(TBonjourRecord *record)
Emit ServiceRegistered signal.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.