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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to