1

Want to develop a robost application, where most of the communication goes p2p, not based any private / cloud / apple provided server.

Q1: Is it possible to send data with URLSession.shared.dataTask method to a device as to a 'server' would? Or need to use 3rd party web sockets stuff?

URLSession.shared.dataTask(with: urlRequest as URLRequest, completionHandler: { data, urlResponse, error in })

Q2: If Q1 is yes, how can device's IP address be fetched? Found this for WiFi based device, but in my device it returns a local IP (192.168.0.2).

Devices are not in close proximit, do not think MultipeerConnectivity framework helps.

Q3: Do you know any tutorial for beginner how to develop P2P app for iOS?

János
  • 32,867
  • 38
  • 193
  • 353
  • 1
    Even if you do get the IP address that your device is NATted behind (which you would have to do by asking an external server) the is a very good chance that the router has a firewall, so your device can not accept incoming connections anyway. You would also need a server to allow devices running your app to discover each other if they aren’t on the same network. – Paulw11 Oct 28 '17 at 19:44
  • You pretty much can't send directly P2P between any two random clients on different networks without at least a server to facilitate the connection. There's an enormous amount written about the various P2P strategies on the internet. The more robust strategies all use some sort of server to at least facilitate the P2P connection. – jfriend00 Oct 28 '17 at 20:54

0 Answers0