Re: Distant DO
Re: Distant DO
- Subject: Re: Distant DO
- From: Brian Webster <email@hidden>
- Date: Tue, 18 Jun 2002 17:15:22 -0500
On Tuesday, June 18, 2002, at 04:16 PM, cocoa-dev-
email@hidden wrote:
I think i can't do that with a server that works remotely because it
seems impossible to establish
a remote connection to a window controller (but only to the
client app).
Can you confirm that ? How could i send
my feedback for each client window ?
I'm pretty sure I understand what you want to do, but let me
know if I misunderstood anything.
Here's what I would do for this:
1. Have the server vend its root object and have your clients
connect to it. Let's say this root object implements a method
like:
-(void)registerFeedbackClient:(id)newClient withName:(NSString*)name
This method would simply add newClient to a collection (probably
a dictionary) maintained by the server.
2. Your client, after having gotten a proxy to the server
object, calls registerFeedbackClient:withName: and passes in the
object you want to get feedback info, along with a unique name;
I guess the object is your window controller in this case. The
server will then have a collection of proxy objects to the
various window controllers in different clients.
3. Whenever an operation happens in the server that you want to
cause feedback, you would fetch the appropriate feedback client
from the dictionary and send it a message with whatever info you
wanted to pass to it for display. The info will go over the
connection and your client can display it however it wants,
whether in be in a window or an NSLog() statement.
All of the communication in this case would actually use the
same NSConnection object, but with multiple proxy objects
belonging to the same connection. By passing in the client
object to the server via a method call rather than having the
server have to go out and find the client, you can avoid the
problem you would have in the remote case.
--
Brian Webster
email@hidden
http://homepage.mac.com/bwebster
_______________________________________________
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.