Bonjour and Airport
Bonjour and Airport
- Subject: Bonjour and Airport
- From: "Gerriet M. Denkmann" <email@hidden>
- Date: Thu, 12 Jul 2007 23:37:03 +0200
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?
Gerriet.
_______________________________________________
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