You need to use Scrip prgogramming with Bonjour. You can even find sample code to connect to a user on the same network as Wi-Fi. You need to use CFReadStream, CFWriteStream and NSNetService. You can also check this code, see It serverless daemon. Link here .. XMPP example
For the file transfer protocol, simply install the TurnSocket Extension. Further XMPP extensions are here at this link: -
XMPP Extensions
Sabby source share