开发者

publish via bonjour on localhost

i've two apps one of them runs an http server and the accesses it. I do not want to hard code the URL or the port in app which is client so I want to publish via bonjour the code for publishing is following

NSString *publishingDomain = @"local."; 
NSString *publishingName = @"some";
NSString* type = @"_http._tcp.";
int port = 1234;

netService = [[NSNetService alloc] initWithDomain:publishingDomain type:type name:publishingName port:port];    

netService.delegate = self;
[netService publish];

while the service is succe开发者_C百科ssfully published bonjour browser lists a bunch of ip addresses under service name but none of them can be used to connect to service whereas I can use both localhost:port and 127.0.0.1:port to access the web server. Bonjour browser does not list 127.0.0.1 as an ip address in the list.

what needs to be done differently to solve this?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜