Re: Distant object on server thread
Re: Distant object on server thread
- Subject: Re: Distant object on server thread
- From: Peter Fischer <email@hidden>
- Date: Thu, 27 May 2004 06:40:24 -0400
I had a similar problem just a few weeks ago. I was however using
DO to communicate through threads, so I was able to pass the pointer
the the object in question by simply casting to an integer.
I'm not sure I entirely follow your question in your email, but I'll
give it my best shot. From you email, it looks like you are able to
successfully create the DO, and are able to communicate with the remote
server object, but when the remote server attempts to access the
NSArray that you had passed the server previously, you get the
exception? If so... I have a potential solution. This was something
someone recommended to me on this list in the past. Subclass, and
override the replacementObjectForPortCoder: message from NSObject.
The default implementation only provides a pass by reference
implementation, enabling all objects to be distributed by proxy as the
default. There is sufficient documentation in the NSObject class to
help you with the overriding of the message.
If I read your email incorrectly, and you are actually having
problems talking to the proxyObject that is a representation of your
remote server, then send more information, and I'll try to give you
more help. Good Luck!
--Pete
On May 26, 2004, at 2:24 AM, A$4Y?n wrote:
>
Hi,
>
>
I have a DO (distributed object) client message a server, giving the
>
server an NSArray of objects. The server spawns a new thread to process
>
the NSArray. But the first attempt to use one of the array objects in
>
the thread results in the server logging an exception, then crashing
>
(client is unaffected):
>
>
Uncaught exception: <NSObjectInaccessibleException> NSDistantObject
>
access attempted from another thread
>
>
Ok, I thought this was simply fixed by using -enableMultipleThreads
>
from the client side before sending the message. But it makes no
>
difference. Using bycopy makes no difference. The old hack of casting
>
the NSArray to an unsigned long results in EXC_BAD_ACCESS.
>
>
Please help!
>
-DW
>
>
_____________________________________________________________________
>
?9;[ FmAvAv?! 8^@O@; :83;<<?d - >_HD! 8^@O
>
http://mail.yahoo.co.kr
>
=EBw,A_0mBw,Aw0E7! 8E90@L GQ@Z8.?! - >_HD! @Z5?Bw
>
http://autos.yahoo.co.kr/autos/
>
_______________________________________________
>
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.
_______________________________________________
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.