Re: Distributed Object, exception failure not handled properly
Re: Distributed Object, exception failure not handled properly
- Subject: Re: Distributed Object, exception failure not handled properly
- From: George Lawrence Storm <email@hidden>
- Date: Wed, 18 Jan 2006 09:43:36 -0800
My code is based on the example from "Advanced Mac OS X Programming"
chapter 18, which is based on NSSocketPort.
As to unavailable, as part of my testing for exception handling I
shut the server down, then test, in which case I get the error as
soon as I step into the call.
My messages are indeed oneway, however the error is occurring long
before I try to send the message, it happens during my connect phase
when I attempt to get the proxy.
George Lawrence Storm
Macintosh Applications Development
Edmonds (Seattle), Washington
E-mail: <email@hidden>
-----
On Jan 18, 2006, at 6:54 AM, Aurélien Hugelé wrote:
are you using MachPort or SocketPort ?
if your are using socketPort, what do you *exactly* means by
"server unavailable" ? if you mean asleep, (i talk about the Mac
server beeing in deep sleep mode), then you have discovered the
nightiest bug i ever had with DO : non working timeouts!
indeed, if the server is asleep, the timeout will NEVER occurs, and
your client will block forever...
As you'll discover on this list, MANY of us claims that Apple does
not support their DO technology enough, even if it is incredibly
powerful...
To solve your problem, (if you are using socket) you'll have to
ping the server regularly, and use almost ONLY oneway void
qualified messages...
On 18 janv. 06, at 10:56, George Lawrence Storm wrote:
I tried adding:
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(connectionTimedOut:)
name:NSPortTimeoutException
object:connection];
prior to getting the proxy and still am receiving the same error
and it is not firing my connectionTimedOut:.
I am using Distributed Objects to communicate in a client/server
model. Everything is working as expected in normal use.
I am currently working on testing my exceptions, in the case of
one exception (server unavailable) I am getting a failure in
which my client quits with a (+56) error () which is not being
caught by my my handler.
Is there a workaround (possibly a pre-test), or am I wrapping
this improperly?
NS_DURING
// Get the proxy
proxy = [[connection rootProxy] retain]; // line where
failure occurs
...
NS_HANDLER
...
NS_ENDHANDLER
-----
George Lawrence Storm
Macintosh Applications Development
Edmonds (Seattle), Washington
E-mail: <email@hidden>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40gumitech.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden