00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef ROOT_TBonjourRegistrar
00013 #define ROOT_TBonjourRegistrar
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #ifndef ROOT_TObject
00038 #include "TObject.h"
00039 #endif
00040 #ifndef ROOT_TQObject
00041 #include "TQObject.h"
00042 #endif
00043 #ifndef ROOT_TBonjourRecord
00044 #include "TBonjourRecord.h"
00045 #endif
00046
00047 #if !defined(__CINT__)
00048 #include <dns_sd.h>
00049 #else
00050 typedef ULong_t DNSServiceRef;
00051 typedef UInt_t DNSServiceFlags;
00052 typedef Int_t DNSServiceErrorType;
00053 #endif
00054
00055 class TFileHandler;
00056
00057
00058 class TBonjourRegistrar : public TObject, public TQObject {
00059
00060 private:
00061 DNSServiceRef fDNSRef;
00062 TFileHandler *fBonjourSocketHandler;
00063 TBonjourRecord fFinalRecord;
00064
00065 void *GetSender() { return this; }
00066
00067 #if !defined(__CINT__)
00068 static void DNSSD_API BonjourRegisterService(DNSServiceRef, DNSServiceFlags, DNSServiceErrorType,
00069 const char *, const char *, const char *, void *);
00070 #else
00071 static void BonjourRegisterService(DNSServiceRef, DNSServiceFlags, DNSServiceErrorType,
00072 const char *, const char *, const char *, void *);
00073 #endif
00074
00075 public:
00076 TBonjourRegistrar();
00077 virtual ~TBonjourRegistrar();
00078
00079 Int_t RegisterService(const TBonjourRecord &record, UShort_t servicePort);
00080 TBonjourRecord RegisteredRecord() const { return fFinalRecord; }
00081
00082 void ServiceRegistered(TBonjourRecord *record);
00083
00084 void BonjourSocketReadyRead();
00085
00086 ClassDef(TBonjourRegistrar,0)
00087 };
00088
00089 #endif