I am trying to implement a conversation with iPhone/iPad devices using DNSServiceRegister to register devices and DNSServiceBrowse to find services and resolve.
How can I send messages between the 'client' and the service? there is any listener that I can put on the service to listen for messages via socket?
There is a delegate you have to set when you start browsing for devices and there is
– netServiceBrowser:didFindService:moreComing:
where you have to "resolve" the service ... after that (another delegate with- (void)netServiceDidResolveAddress:
) you can get In/Out sockets withgetInputStream:outputStream:
. after that you can start communication. You can find more here https://developer.apple.com/library/ios/#documentation/Networking/Conceptual/NSNetServiceProgGuide/Introduction.html or here https://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/Streams/Streams.html there is also example WiTap which doeas basically the same thing.