Seeking best practices for peer device detection on ad-hoc network for replication.

16 views
Skip to first unread message

Alex Zavatone

unread,
Oct 30, 2017, 3:05:59 PM10/30/17
to mobile-c...@googlegroups.com
As requested by Traun Leyden, here is the new thread/Topic.

Regarding iOS peer to peer replication in Couchbase, I am looking for "best approach" advice on how to solve this peer to peer replication problem.

Our app is built in Swift and will be operating in an isolated hospital on iPads and there is no guarantee of a stable and reachable network.  Assuming a maximum of 9 devices, we opted to test the stability of peer to peer by using Apple's peer to peer communication and discovery to identify peers and join a "room" with the MultipeerConnectivity.framework.  

The Apple sample project used to test this on 9 iPads was this project: MultipeerGroupChat. 

While this worked in the simple case, as soon as > 4 devices connected to one room, devices would randomly disconnect, reconnect to ghost instances, return error messages from deep in private classes, even with Apple's own sample code.   Using this multipeer framework would clearly create a nightmare situation when more than 4 devices were in range within another on the other side of the planet.

I've reviewed Pasin's Peer to Peer Photo example here:

What I'm unclear on is how is which approach is being used for device discovery.  In Pasin's tutorial, how is device discovery performed when a device comes within range?  We need to handle this issue before we start a replication.  

Once multiple devices are connected, we can not tolerate random drops of devices, or ghost attempts to connect to the device.

Thanks in advance.

Alex Zavatone

Jens Alfke

unread,
Nov 1, 2017, 4:34:49 PM11/1/17
to Couchbase Mobile


> On Oct 30, 2017, at 12:05 PM, Alex Zavatone <alexza...@gmail.com> wrote:
>
> What I'm unclear on is how is which approach is being used for device discovery. In Pasin's tutorial, how is device discovery performed when a device comes within range? We need to handle this issue before we start a replication.

Bonjour, i.e. NSNetService and NSNetServiceBrowser.

—Jens
Reply all
Reply to author
Forward
0 new messages