Distributed Object Help!
Distributed Object Help!
- Subject: Distributed Object Help!
- From: warren marco <email@hidden>
- Date: Sun, 31 Mar 2002 02:36:13 -0700
I'm having a problem concerning the notification
NSConnectionDidDieNotification. The problem occurs when my PDO server is
shutdown and a client is still connected. When the client attempts to
send a RPC it hangs indefinetly. I click a button on the client GUI
which basically does this:
if([theConnection isValid] == NO) {NSLog(@"Connection not valid");
exit(1);};
[proxy remoteNSBeep];
After checking it out in the debugger the connection is returned as
valid. Hangs on the remoteNSBeep call. During the creation of the client
connection I call the following:
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(connectionDidDie:)
name:NSConnectionDidDieNotification
object:nil];
Note that I set the object to nil just to see if I could get any
NSConnectionDidDieNotification from any NSConnection. Originaly it was
set to myConnection. Now to my understanding when the server dies the
NSConnection will realize this and send off this notification. Then
again I could be totally wrong. Anyone know whats going on?
Anyone use NSSocketPortNameServer before? does it actually work? I
tried using it before but it only caused headaches and more problems. Do
I use:
[someNSConnection registerName:@"b" withServer:
[ NSSocketPortNameServer sharedInstance]];
or
[someNSConnection registerName:@"b"];
or
[NSConnection registerName:@"b" withServer:[ NSSocketPortNameServer
sytsemDefaultPortNameServer]];?
Finally under Apple's documentation of [NSConnection
connectionWithReceivePort:a sendPort:b]; it states:
If receivePort is nil, deallocates the receiver and returns nil.
Then how come when using sockets it isnt necessary to provide it? I
understand a socket is already bidirectional. Is Apple just forgetting
to mention that in documentation ussing sockets this isnt necessary?
this works just fine:
connection = [NSConnection connectionWithReceivePort:nil sendPort:
someSendPort];
If anyone has idea to any of these questions I'd be grateful.
cheers,
Warren Marco
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.