Re: Bonjour and Airport
Re: Bonjour and Airport
- Subject: Re: Bonjour and Airport
- From: Jacob Engstrand <email@hidden>
- Date: Wed, 18 Jul 2007 11:20:16 +0200
On 12 jul 2007, at 23.37, Gerriet M. Denkmann wrote:
1. netResolver = [ [ NSNetService alloc ] initWithDomain:
@"local." type: someType name: someName];
[ netResolver setDelegate: someObject ];
[ netResolver resolveWithTimeout: someTime ];
"someName" is a Bonjour Service provided by a programm running on
another computer, connected via Ethernet.
2. someObject:
- (void)netServiceDidResolveAddress:(NSNetService *)sender
{
NSArray *addresses = [ sender addresses ];
// select some address with sa_family = PF_INET
NSSocketPort *porT = [ [ NSSocketPort alloc ]
initRemoteWithProtocolFamily: PF_INET socketType: SOCK_STREAM
protocol: IPPROTO_TCP address: adr ];
outConnection = [ [ NSConnection alloc ] initWithReceivePort: nil
sendPort: porT ];
serverProxy = [ outConnection rootProxy ] ;
[ serverProxy someMessage];
}
This works ok if Sytem Preferences -> Network -> Network Status shows:
(green) Build-in Ethernet currently active. You are connected to
the Internet via Build-in Ethernet.
(red) Airport off
But when I see:
(green) Airport on. You are connected to the Internet via Airport
(green) Build-in Ethernet currently active.
then [ outConnection rootProxy ] creates an NSPortTimeoutException.
What am I doing wrong?
Take a look at Technical Q&A QA1333 - Duplicate Bonjour services
while browsing.
http://developer.apple.com/qa/qa2001/qa1333.html
jak
_______________________________________________
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