简体   繁体   中英

How to share images between 2 users directly?

I am a newbie, please be lenient towards me. Please let me elaborate.

Goal

Transfer Data(images, files) between devices.

What I am doing?

  1. Sending the file to server
  2. Sending path to the other user
  3. the other user starts to download the image from the path.

Problem

I need to make the file transfer direct between devices and minimize the role of the server as far as possible.

PS: I am trying to build a screen share COCOA app like we do in SKYPE calling. I am thinking of sharing screenshots as quickly as possible. Any suggestions are most welcome. Please let me know if my approach is good or bad.

You can use Multipeer Connectivity Framwork that support for discovering services provided by nearby iOS devices.

Refrence : ( https://developer.apple.com/library/ios/documentation/MultipeerConnectivity/Reference/MultipeerConnectivityFramework/ )

I have no personal experience with this, but you should try to use UPnP . It has to be enabled on the firewall for at least one device, so it can open an external port. See also this thread. The devices would use the server to tell each other where they can be reached and then switch to that direct connection.

There are also other NAT Traversal techniques.

Another possibility might be using IPv6, if both devices have an IPv6 address (but I have really no experience with that).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM