Re: Distant object on server thread
Re: Distant object on server thread
- Subject: Re: Distant object on server thread
- From: 정다운 <email@hidden>
- Date: Thu, 27 May 2004 11:46:00 +0900 (JST)
It didn't work. :-(
I tried inserting the following lines into the server, just before I
detach my worker thread:
NSConnection *conn = [NSConnection
connectionWithRegisteredName:CONNECTION_NAME host:nil];
// conn is non-nil, I checked in the debugger
[conn enableMultipleThreads];
Not a difference. On a hunch, I also tried inserting the
enableMultipleThreads code into the worker thread itself. No cigar! I
also tried using enableMultipleThreads in both the server and client.
No bloody difference.
So... any ideas on how to access distant objects on a server thread? Or
at least a way to make them not-so-distant?
Cheers,
DW
--- James Chen <email@hidden> wrote:
>
Hi,
>
How about send enableMultipleThreads to the connection on server side
>
>
but not client.
>
HTH,
>
James
>
------------------------------------
>
Ulead Systems Inc.
>
James Chen
>
Software Engineer
>
Image Div.
>
------------------------------------
>
On May 26, 2004, at 2:24 PM, I 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
__________________________________
Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/
_______________________________________________
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.