Newbie Q (Distributed Objects)
Newbie Q (Distributed Objects)
- Subject: Newbie Q (Distributed Objects)
- From: Chris Eccles <email@hidden>
- Date: Sat, 24 Apr 2010 23:11:04 +0100
Hello
I am relatively new to Cocoa but learning fast.
I have a specific problem which I hope may be answered by the
expertise on this forum.
I cannot seem to get a 'client' app to make a connection to a vended
object in a 'server' app across my LAN. The relevant code in my 'server' app
is:
- (void)awakeFromNib {
// create the comms port for receiving
port = [[[NSSocketPort alloc] initWithTCPPort:60000] retain];
NSLog(@"Socket Port = %@", [port address]);
// set up, retain and register the connection
connection = [[[NSConnection alloc] initWithReceivePort: port sendPort:
port] retain];
[connection setRootObject:self];
[connection registerName: @"medix"];
NSLog(@"Connection = %@", connection);
}
This seems to work fine. The port is open and the NSLog confirms the
structure of the connection.
The problem lies in my 'client' code (I think):
- (void)awakeFromNib {
// set up and retain connection
connection = [[NSConnection connectionWithRegisteredName:@"medix"
host:@"192.168.1.2"]
retain];
NSLog(@"Connection Setup %@\n\n\n", connection);
remObject = [connection rootProxy];
NSLog(@"Connection Setup %@\n\n\n", remObject);
[remObject retain];
}
.. which refuses to connect and which does NOT display the remObject
as having been found and assigned in NSLog, but simply (null).
Am I doing something so obviously crazy that I can't see it ? ?
Thanks in advance
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:
This email sent to email@hidden