• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Distributed Objects and Bonjour
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Distributed Objects and Bonjour


  • Subject: Distributed Objects and Bonjour
  • From: Robert Sesek <email@hidden>
  • Date: Mon, 26 Jun 2006 11:40:56 -0700

Hello,

I'm trying to get Distributed Objects and Bonjour to work together. I've found various examples of these two items working independently, but I cannot seem to get them to work together.

TI can broadcast and browse my Bonjour service and I setup my D-O system like this:

- (void)startDistributedObject
{
	connection = [NSConnection connectionWithReceivePort: socket
												sendPort: nil];
	[connection setRootObject: [manager dbConnector]];
	[[NSSocketPortNameServer sharedInstance] registerPort: socket
													 name: @"TindexServer"];
}

In the client, I browse for services and I have an NSMutableArray of NSNetService's that are of the service type _tindex._tcp. When somebody wants to connect to the server this method is executed (by clicking on a button):

- (IBAction)connectToServer: (id)sender
{
id proxy;
NSData *addy;

if ([serverList indexOfSelectedItem] != 0)
{
netService = [servers objectForKey: [serverList titleOfSelectedItem]];
NSLog(@"selected service: %@", netService);

socket = [[NSSocketPortNameServer sharedInstance] portForName: @"TindexServer"
host: [netService name]];
connection = [NSConnection connectionWithReceivePort: nil
sendPort: socket];
//proxy = [connection rootProxy];
addy = [socket address];

NSLog(@"socket = %@", socket);
NSLog(@"ipaddy = %@", [socket address]);
NSLog(@"connection = %@", connection);
//NSLog(@"proxy = %@", proxy);
}
else
{
NSLog(@"Current selection: <none>");
}
}


This above is the problemed code. I have no idea why this isn't working. When I uncomment the two lines above, then I get a crash. I've tried searching for so many examples, but can't find anything that works.

Any help or advice would be appreciated.

Robert Sesek
Email: email@hidden
www.iris-studios.com

_______________________________________________
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


  • Prev by Date: Re: CILinearGradient not linear?
  • Next by Date: Distributed Objects and Bonjour
  • Previous by thread: Re: CILinearGradient not linear?
  • Next by thread: Re: Distributed Objects and Bonjour
  • Index(es):
    • Date
    • Thread