Fix notification usage.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@4410 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 1999-06-16 10:23:33 +00:00
parent 3ddb85c25c
commit 4126859bd5
3 changed files with 26 additions and 22 deletions

View file

@ -903,7 +903,8 @@ static int messages_received_count;
outPort: (NSPort*)op
ancestorConnection: (NSConnection*)ancestor
{
NSConnection *newConn;
NSNotificationCenter *nCenter;
NSConnection *newConn;
NSParameterAssert (ip);
@ -1034,15 +1035,16 @@ static int messages_received_count;
/* Register ourselves for invalidation notification when the
ports become invalid. */
[NSNotificationCenter addObserver: newConn
selector: @selector(portIsInvalid:)
name: NSPortDidBecomeInvalidNotification
object: ip];
nCenter = [NSNotificationCenter defaultCenter];
[nCenter addObserver: newConn
selector: @selector(portIsInvalid:)
name: NSPortDidBecomeInvalidNotification
object: ip];
if (op)
[NSNotificationCenter addObserver: newConn
selector: @selector(portIsInvalid:)
name: NSPortDidBecomeInvalidNotification
object: op];
[nCenter addObserver: newConn
selector: @selector(portIsInvalid:)
name: NSPortDidBecomeInvalidNotification
object: op];
/* if OP is nil, making this notification request would have
registered us to receive all NSPortDidBecomeInvalidNotification
requests, independent of which port posted them. This isn't

View file

@ -787,6 +787,7 @@ static NSPortNameServer *defaultServer = nil;
- (void) _open: (NSString*)host
{
NSNotificationCenter *nc;
NSRunLoop *loop;
NSString *hostname = host;
BOOL isLocal = NO;
@ -870,18 +871,19 @@ static NSPortNameServer *defaultServer = nil;
expecting = 1;
[handle retain];
[NSNotificationCenter addObserver: self
selector: @selector(_didConnect:)
name: GSFileHandleConnectCompletionNotification
object: handle];
[NSNotificationCenter addObserver: self
selector: @selector(_didRead:)
name: NSFileHandleReadCompletionNotification
object: handle];
[NSNotificationCenter addObserver: self
selector: @selector(_didWrite:)
name: GSFileHandleWriteCompletionNotification
object: handle];
nc = [NSNotificationCenter defaultCenter];
[nc addObserver: self
selector: @selector(_didConnect:)
name: GSFileHandleConnectCompletionNotification
object: handle];
[nc addObserver: self
selector: @selector(_didRead:)
name: NSFileHandleReadCompletionNotification
object: handle];
[nc addObserver: self
selector: @selector(_didWrite:)
name: GSFileHandleWriteCompletionNotification
object: handle];
loop = [NSRunLoop currentRunLoop];
[loop runMode: mode
beforeDate: [NSDate dateWithTimeIntervalSinceNow: connectTimeout]];

View file

@ -698,7 +698,7 @@ deserializeFromInfo(_NSDeserializerInfo* info)
}
else
{
[NSNotificationCenter
[[NSNotificationCenter defaultCenter]
addObserver: self
selector: @selector(_becomeThreaded:)
name: NSWillBecomeMultiThreadedNotification