Question

I am currently experiencing a bug that causes iPads to randomly disconnect from the session, but only on one side.

At the beginning of the test

A ----> B

B ----> A

After a requests thats b send it some info

A ----> B

B ? A

I am currently testing this program with one dominate iPad (browser) and 15 other iPads (advertisers).

I am aware that sometimes calling sendData: to often or with to much data can cause disconnects, I am also aware of 8 default max on the MCSession. Which I why I create a new session after 6 peers have been found nearby.

I have discovered one thing about this bug. On the first trial of the test, there seems to be no disconnects however, after stopping the test, and beginning a second trial disconnects happen, usually 3-6 iPads. And I am properly ending the sessions, stopping browsing and advertising. However if I turn off/turn on all the iPads wifi and Bluetooth, the testing shows few (maybe 1) disconnect.

Strange problem which I seem unable to solve.

Was it helpful?

Solution 2

Calling sendData: to often or attempting to sendData: to many peers causes disconnects.

OTHER TIPS

I have been working on an open source library for multipeer connectivity and have seen many of the things you've seen.

So far, all I have are guesses, but I'll fill you in with what I've found.

  1. Are you sending invites both ways? If so, I've found it randomly disconnects after 10secs - 2 mins.
  2. Are you declining invite one way? I think this is also wrong. Instead, I think you should only send invites one way.
  3. Are you advertising or browsing while you send data? This is what I'm currently looking into, but I think it causes problems.

My suggestion to debug: Send an invitation from one device to the other and accept. Don't go both ways. Then, turn off all browsing and advertising. Then see where you get to.

Let me know how it goes. I'm trying to debug these same issues right now, so any info on what other people are seeing would be very helpful. Thanks.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top