From fb676b3d9ae0ac335ed28280a1e616ae432e9a0a Mon Sep 17 00:00:00 2001 From: Richard Frith-Macdonald Date: Sun, 24 Oct 2004 06:13:24 +0000 Subject: [PATCH] Fix for when default nameserver is host-local. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@20254 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 5 +++++ Source/NSDistributedNotificationCenter.m | 16 +++++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index e9342c085..a80a078a2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-10-24 Richard Frith-Macdonald + + * Source/NSDistributedNotificationCenter.m: Changed to explicitly + use a socket port name server for network wide notifications. + 2004-10-21 Fred Kiefer * Source/NSPropertyList.m (GSBinaryPLParser objectAtIndex:): diff --git a/Source/NSDistributedNotificationCenter.m b/Source/NSDistributedNotificationCenter.m index b074d33a8..3e539169c 100644 --- a/Source/NSDistributedNotificationCenter.m +++ b/Source/NSDistributedNotificationCenter.m @@ -39,6 +39,7 @@ #include "Foundation/NSDistributedNotificationCenter.h" #include "Foundation/NSUserDefaults.h" #include "Foundation/NSHost.h" +#include "Foundation/NSPortNameServer.h" #include "../Tools/gdnc.h" @@ -616,9 +617,18 @@ static NSDistributedNotificationCenter *netCenter = nil; format: @"Unknown center type - %@", _type]; } - - _remote = RETAIN([NSConnection rootProxyForConnectionWithRegisteredName: - service host: host]); + if ([host isEqualToString: @"*"] == YES) + { + _remote = [NSConnection rootProxyForConnectionWithRegisteredName: + service host: host + usingNameServer: [NSSocketPortNameServer sharedInstance]]; + } + else + { + _remote = [NSConnection rootProxyForConnectionWithRegisteredName: + service host: host]; + } + RETAIN(_remote); if (_type == NSLocalNotificationCenterType && _remote == nil && [host isEqual: @""] == NO)