nsnetservice

NSNetServiceBrowser does not find Service

坚强是说给别人听的谎言 提交于 2019-12-06 11:43:40
I tried to write a Client(iPad)/Server(iMac) application based on the CocoaEcho example. My first simple example worked, but after adding more functionality the client is unable to find the server. After starting the server, I start the client, both in a local network. The client starts searching for services and gets a "netServiceBrowserWillSearch:" message for its browser, but after that nothing happens. Triggering the search for services again, results in a "didNotsearch:" message with error -72003, 10 (browser is still busy searching). 1) I checked that the server is reachable with the

Using NSNetService class to make an SMB tcp ip connection to a folder shared on windows machine

瘦欲@ 提交于 2019-12-03 14:09:07
问题 I have been trying to figure out a way to access my windows shared folder using iPhone. The desired functionality is part of bigger enterprise app I am building. Here is someone who has already asked a similar question but no luck - Does iOS support file operations via SMB? Now, I have found apple developer tutorial called "SimpleNetworkStreams" which employs NSNetService to use x-SNSUpload protocol over tcp by setting type of NSNetService instance to protocol x-SNSUpload._tcp Here is how

Using NSNetService class to make an SMB tcp ip connection to a folder shared on windows machine

一笑奈何 提交于 2019-12-03 05:06:21
I have been trying to figure out a way to access my windows shared folder using iPhone. The desired functionality is part of bigger enterprise app I am building. Here is someone who has already asked a similar question but no luck - Does iOS support file operations via SMB? Now, I have found apple developer tutorial called " SimpleNetworkStreams " which employs NSNetService to use x-SNSUpload protocol over tcp by setting type of NSNetService instance to protocol x-SNSUpload._tcp Here is how they have done it - self.netService = [[[NSNetService alloc] initWithDomain:@"local." type:@"_x

NSNetService on WiFi instead of bluetooth

左心房为你撑大大i 提交于 2019-12-01 12:17:37
I have 2 iOS devices and an application which starts or connects to a NSNetService. When both devices have have bluetooth turned on the data stream will automatically be done over the bluetooth interface. I do not want that, i want both devices to communicate over the WiFi. Is there a way to force a NSNetService to communicate over the WiFi? Thanks I don't think there is, I haven't looked into the docs, but I know a ton of games recommend disabling Bluetooth and ensuring WiFi is enabled for local multiplayer. 来源: https://stackoverflow.com/questions/6650452/nsnetservice-on-wifi-instead-of

Swift 3 how to resolve NetService IP?

可紊 提交于 2019-12-01 03:50:21
问题 Just trying Bonjour in swift 3 Here is my code , I can receive the delegate func netServiceDidResolveAddress(_ sender: NetService) { print("netServiceDidResolveAddress service name \(sender.name) of type \(sender.type)," + "port \(sender.port), addresses \(sender.addresses)") } And here is my result netServiceDidResolveAddress service name Webber's Mac mini of type _myapp._tcp.,port 5678, addresses Optional([<1002162e c0a80205 00000000 00000000>, <1c1e162e 00000000 fe800000 00000000 00bce7ad

Disconnecting with server immediately after connecting

僤鯓⒐⒋嵵緔 提交于 2019-11-30 16:00:42
I have written a Singleton Class using GCDAsyncsocket Library to establish connection with any other device having same service using Bonjour. On one device I am using its Method " startPublishing " to make it a Host(Server), from the Application on another Device(Client) I am calling " StartBrowsing " to find out the available Devices in Network. When user selects any of service in that Network I am calling method " initConnectionWithService ", that initiate Connection flow by resolving address of NetService to connect. BonjourUtilClass.h @interface BonjourUtilClass : NSObject

NSNetServiceBrowser/Bonjour issues on iOS

被刻印的时光 ゝ 提交于 2019-11-30 11:50:36
I'm using Bonjour (NSNetServiceBrowser, to be precise) over WiFi in an app I'm developing for an iOS project I've been working on. However, despite noting the issues raised in the excellent response at Why does NSNetServiceBrowser find unpublished services in iPhone OS? I am still encountering a number of difficulties with NSNetSericeBrowser. My set-up is as follows: Working with iPads running iOS 4.5.3. Using an AirPort Express as an access point/router. Running dns-sd -B _serviceName on my Mac connected to the network works fine -- that is to say, all calls to publish and stop are

Disconnecting with server immediately after connecting

梦想的初衷 提交于 2019-11-29 22:31:47
问题 I have written a Singleton Class using GCDAsyncsocket Library to establish connection with any other device having same service using Bonjour. On one device I am using its Method " startPublishing " to make it a Host(Server), from the Application on another Device(Client) I am calling " StartBrowsing " to find out the available Devices in Network. When user selects any of service in that Network I am calling method " initConnectionWithService ", that initiate Connection flow by resolving

NSNetService works fine, but can't get hostName, resolve causes error

那年仲夏 提交于 2019-11-28 08:48:40
问题 I'm using Bonjour with an NSNetService to publish a server from my iPhone. It all works as expected, I can browse the pages I'm serving etc. However, on the iPhone I want to display the host name (i.e. the URL, like "myDevice.local."), so that one can also enter the address manually in a browser (useful for clients missing a bonjour discovery service). My understanding is that calling the method [myNetService hostName] should give me that address. However, this call always returns nil. I read