NSDistributedObjects & Fast User Switching
NSDistributedObjects & Fast User Switching
- Subject: NSDistributedObjects & Fast User Switching
- From: Pat Homelvig <email@hidden>
- Date: Sat, 21 May 2005 16:05:58 -0600
We have a client / server setup, and are using distributed objects to
connect between the two.
For a demo that we are giving, we were going to have four clients
connect up to the server, with each client as a separate login on the
same machine via "Fast User Switching". The server is also running
on the same machine, started up ahead of time by the first user.
We start up the server, and then start up the client under the same
user's login, and everything works fine, However in starting up the
client on any of the other logins, it can't connect up to the
server. Both the connection and proxy returns nil.
Following is the code we are using:
Server:
NSConnection *conn = [NSConnection defaultConnection];
// Configure the connection
DemoDataServer *dataServer = [[DemoDataServer alloc] init];
[conn setRootObject:dataServer];
if ([conn registerName:@"DemoServer"] == NO) {
/* Handle error. */
NSLog(@"Unable to register connection as \"DemoServer\"");
exit(-1);
}
// Start the connection
[[NSRunLoop currentRunLoop] run];
Client:
NSConnection *conn = [NSConnection
connectionWithRegisteredName:@"DemoServer" host:nil];
serverProxy = [[conn rootProxy] retain];
[serverProxy setProtocolForProxy:@protocol
(QCMDataServerProtocol)];
As I said above, conn and serverProxy both are nil on any user but
the user that starts the server.
Any ideas?
Thanks
Pat
_______________________________________________
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