Re: Distirbuted Objects error handling?
Re: Distirbuted Objects error handling?
- Subject: Re: Distirbuted Objects error handling?
- From: Douglas Davidson <email@hidden>
- Date: Thu, 28 Feb 2002 16:34:21 -0800
On Thursday, February 28, 2002, at 09:18 AM, Rafael K. Kobylinski wrote:
I read the documentation and searched the list, but was not able to
find any method to find out if the listening port I create with
[[NSConnection alloc] initWithReceivePort:receivePort sendPort:nil] is
really created or fails immediately because the port is in use. Is
there a way to check this?
The listening port should be created with the receivePort. If you
create it with initWithTCPPort: or
initWithProtocolFamily:socketType:protocol:address:, then the receive
port should be created bound to the specified port number, or those
methods should return nil if that is not possible.
Another problem is on the client side, where I do register for
NSConnectionDidDieNotification but I am not notified if the server
crashes (I know that on the TCP level there is no way to find that out
unless you check the connection periodically). Actually it's the same
on the server side. Is this the correct behaviour?
I have written exception handlers to catch NSPortTimeoutException
around messages to remote objects. What else should I do? Are there any
examples on using Distributed Objects which would include full error
handling the "right" way?
As you note, this is a difficult problem in general. At the moment, the
NSConnectionDidDieNotification is not delivered for remote connections
because of the difficulty of determining reliably whether the other side
has actually died or is merely delayed, sleeping, pining for the fjords,
etc. A timeout is probably the right way to go.
Douglas Davidson
_______________________________________________
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.