39 #include <arpa/inet.h> 61 DNSServiceRefDeallocate(
fDNSRef);
73 Warning(
"RegisterService",
"already registered a service");
80 DNSServiceErrorType err = DNSServiceRegister(&
fDNSRef, 0, kDNSServiceInterfaceIndexAny,
92 if (err != kDNSServiceErr_NoError) {
93 Error(
"RegisterService",
"error in DNSServiceRegister (%d)", err);
99 Error(
"RegisterService",
"invalid sockfd");
115 Emit(
"ServiceRegistered(TBonjourRecord*)", (
Long_t)record);
125 DNSServiceErrorType err = DNSServiceProcessResult(
fDNSRef);
126 if (err != kDNSServiceErr_NoError)
127 Error(
"BonjourSocketReadyRead",
"error in DNSServiceProcessResult");
134 DNSServiceErrorType errCode,
135 const char *
name,
const char *regType,
136 const char *domain,
void *context)
139 if (errCode != kDNSServiceErr_NoError) {
140 ::Error(
"TBonjourRegistrar::BonjourRegisterService",
"error in BonjourRegisterService");
TBonjourRegistrar()
Default ctor.
Int_t GetTXTRecordsLength() const
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
void BonjourSocketReadyRead()
The Bonjour socket is ready for reading.
virtual ~TBonjourRegistrar()
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...
virtual void Setenv(const char *name, const char *value)
Set environment variable.
R__EXTERN TSystem * gSystem
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
TBonjourRecord fFinalRecord
const char * GetReplyDomain() const
static void DNSSD_API BonjourRegisterService(DNSServiceRef, DNSServiceFlags, DNSServiceErrorType, const char *, const char *, const char *, void *)
Static Bonjour register callback function.
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.
void ServiceRegistered(TBonjourRecord *record)
Emit ServiceRegistered signal.