mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-25 09:41:15 +00:00
Finnaly working NSNetServices via avahi-client.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@30956 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
15f33318ea
commit
71b2a1ff73
4 changed files with 49 additions and 43 deletions
|
@ -1,3 +1,12 @@
|
||||||
|
2010-07-13 Niels Grewe <niels.grewe@halbordnung.de>
|
||||||
|
|
||||||
|
* Headers/Foundation/NSNetServices.h: Update to a version working with
|
||||||
|
both mDNSResponder and Avahi.
|
||||||
|
* Source/GSAvahiNetService.m: Fix leftover duplicate variables.
|
||||||
|
* Source/GSNetServices.h: Revert to r30954, but add padding ivars to
|
||||||
|
the Avahi classes.
|
||||||
|
Make Avahi-NSNetServices work again.
|
||||||
|
|
||||||
2010-07-13 Niels Grewe <niels.grewe@halbordnung.de>
|
2010-07-13 Niels Grewe <niels.grewe@halbordnung.de>
|
||||||
|
|
||||||
* Source/NSNetServices.m: Replace with the new version.
|
* Source/NSNetServices.m: Replace with the new version.
|
||||||
|
|
|
@ -127,12 +127,7 @@ GS_EXPORT NSString * const NSNetServicesErrorDomain;
|
||||||
|
|
||||||
@interface NSNetService : NSObject
|
@interface NSNetService : NSObject
|
||||||
{
|
{
|
||||||
#if GS_EXPOSE(NSNetService)
|
|
||||||
@private
|
|
||||||
void *_netService;
|
|
||||||
id _delegate;
|
id _delegate;
|
||||||
void *_reserved;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (NSData *) dataFromTXTRecordDictionary: (NSDictionary *) txtDictionary;
|
+ (NSData *) dataFromTXTRecordDictionary: (NSDictionary *) txtDictionary;
|
||||||
|
@ -214,12 +209,7 @@ GS_EXPORT NSString * const NSNetServicesErrorDomain;
|
||||||
|
|
||||||
@interface NSNetServiceBrowser : NSObject
|
@interface NSNetServiceBrowser : NSObject
|
||||||
{
|
{
|
||||||
#if GS_EXPOSE(NSNetServiceBrowser)
|
|
||||||
@private
|
|
||||||
void *_netServiceBrowser;
|
|
||||||
id _delegate;
|
id _delegate;
|
||||||
void *_reserved;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id) init;
|
- (id) init;
|
||||||
|
|
|
@ -642,7 +642,6 @@ GSAvahiEntryGroupStateChanged(AvahiEntryGroup *group,
|
||||||
- (void) netService: (NSNetService*)service
|
- (void) netService: (NSNetService*)service
|
||||||
didUpdateAddresses: (NSArray*)addresses
|
didUpdateAddresses: (NSArray*)addresses
|
||||||
{
|
{
|
||||||
id _delegate = [self delegate];
|
|
||||||
if ([_delegate respondsToSelector: @selector(netService:didUpdateAddresses:)])
|
if ([_delegate respondsToSelector: @selector(netService:didUpdateAddresses:)])
|
||||||
{
|
{
|
||||||
[_delegate netService: service
|
[_delegate netService: service
|
||||||
|
@ -655,7 +654,6 @@ didUpdateRecordData: (id)data
|
||||||
forRecordType: (NSString*)rrType
|
forRecordType: (NSString*)rrType
|
||||||
{
|
{
|
||||||
SEL theSelector = NULL;
|
SEL theSelector = NULL;
|
||||||
id _delegate = [self delegate];
|
|
||||||
if ([rrType isEqualToString: @"A"] || [rrType isEqualToString: @"AAAA"])
|
if ([rrType isEqualToString: @"A"] || [rrType isEqualToString: @"AAAA"])
|
||||||
{
|
{
|
||||||
[self netService: service didUpdateAddresses: [self addresses]];
|
[self netService: service didUpdateAddresses: [self addresses]];
|
||||||
|
@ -690,7 +688,6 @@ didUpdateRecordData: (id)data
|
||||||
didNotMonitor: (NSDictionary*)errorDict
|
didNotMonitor: (NSDictionary*)errorDict
|
||||||
forRecordType: (NSString*)rrType
|
forRecordType: (NSString*)rrType
|
||||||
{
|
{
|
||||||
id _delegate = [self delegate];
|
|
||||||
SEL theSelector = NSSelectorFromString([NSString stringWithFormat:
|
SEL theSelector = NSSelectorFromString([NSString stringWithFormat:
|
||||||
@"netService:didNotMonitor%@RecordData:", rrType]);
|
@"netService:didNotMonitor%@RecordData:", rrType]);
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,10 @@
|
||||||
* NSNetService using the mDNSResponder API.
|
* NSNetService using the mDNSResponder API.
|
||||||
*/
|
*/
|
||||||
@interface GSMDNSNetService : NSNetService
|
@interface GSMDNSNetService : NSNetService
|
||||||
|
{
|
||||||
|
void *_netService;
|
||||||
|
void *_reserved;
|
||||||
|
}
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
||||||
|
@ -40,6 +44,10 @@
|
||||||
* NSNetServiceBrowser using the mDNSResponder API.
|
* NSNetServiceBrowser using the mDNSResponder API.
|
||||||
*/
|
*/
|
||||||
@interface GSMDNSNetServiceBrowser : NSNetServiceBrowser
|
@interface GSMDNSNetServiceBrowser : NSNetServiceBrowser
|
||||||
|
{
|
||||||
|
void *_netServiceBrowser;
|
||||||
|
void *_reserved;
|
||||||
|
}
|
||||||
@end
|
@end
|
||||||
|
|
||||||
// Subclasses using Avahi:
|
// Subclasses using Avahi:
|
||||||
|
@ -101,6 +109,7 @@ NSString* GSNetServiceDotTerminatedNSStringFromString(const char* string);
|
||||||
NSMapTable *_browsers;
|
NSMapTable *_browsers;
|
||||||
NSMapTable *_browserTimeouts;
|
NSMapTable *_browserTimeouts;
|
||||||
NSTimer *_timer;
|
NSTimer *_timer;
|
||||||
|
id _reserved;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -130,5 +139,6 @@ NSString* GSNetServiceDotTerminatedNSStringFromString(const char* string);
|
||||||
GSAvahiBrowserType _type;
|
GSAvahiBrowserType _type;
|
||||||
BOOL _hasFirstEvent;
|
BOOL _hasFirstEvent;
|
||||||
NSMutableDictionary *_services;
|
NSMutableDictionary *_services;
|
||||||
|
id _reserved;
|
||||||
}
|
}
|
||||||
@end
|
@end
|
||||||
|
|
Loading…
Reference in a new issue