Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Distributed Objects "connection went invalid while waiting for a reply"



Hi Hamish,

On Thu, Jul 31, 2008 at 10:16 PM, Hamish Allan <email@hidden> wrote:

> On Tue, Jul 29, 2008 at 3:33 AM, Chris Suter <email@hidden> wrote:
>
> > It sounds to me like you've got some kind of timing issue and that the
> delay
> > that you're adding is merely hiding the true cause of the problem. Are
> you
> > able to post a simple test case that displays the problem or post the
> code
> > that you're using when you set things up?
>
> I've posted a simple test case at:
>
> $ svn checkout
> http://hamish-cocoa-dev-examples.googlecode.com/svn/trunk/DistributedObjectsTest
> DistributedObjectsTest
>
> The README file explains the class layout. Any insights gratefully
> appreciated.


The reason you're seeing the error is because as soon as you receive the
response in your client, you're printing it and terminating the application
but the server is expecting a response (even though the method has a void
return value). I suspect the reason it works when you use
performSelectorWithDelay: is that the runtime knows that no response is
expected and so the message is sent asynchronously (i.e. as if you'd
specified oneway).

To fix it, add the oneway qualifier to your setAnswerText: method.

I think it would also be prudent to make sure that the client shuts down
gracefully, i.e. call [connection invalidate] at least.

You might want to go through your other methods and consider whether the
oneway qualifier should apply. You could do the same for "bycopy".

-- Chris
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden

References: 
 >Distributed Objects "connection went invalid while waiting for a reply" (From: "Hamish Allan" <email@hidden>)
 >Re: Distributed Objects "connection went invalid while waiting for a reply" (From: "Hamish Allan" <email@hidden>)
 >Re: Distributed Objects "connection went invalid while waiting for a reply" (From: "Chris Suter" <email@hidden>)
 >Re: Distributed Objects "connection went invalid while waiting for a reply" (From: "Hamish Allan" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.