0 Replies
      Latest reply on Jun 24, 2016 8:16 AM by xaphod
      xaphod Level 1 Level 1 (0 points)

        Paging my favorite Eskimo! Or anyone who knows

        I'm having fun with Multipeer, it was really easy to get started. But now i've hit a problem and as far as I can tell, it isn't in my code.  I'm not sure what to do. I'm testing on iOS 9.3 on a variety of devices. The peer that is showing the data corruption is a simulator because it's easiest to debug.


        The issue is that when two peers (P1, P2) simultaneously send data to a third peer (P3), P3 receives the data all munged together. Looking at the MCSessionDelegate didReceiveData callback, I mean this one:


            public func session(session: MCSession, didReceiveData data: NSData, fromPeer peerID: MCPeerID) {


        ... on P3 I see two calls to this as expected. BUT, the NSData of the first call contains bits of data from BOTH peers (P1 and P2).

        In other words, Multipeer isn't safe for anything other than 2 peers, at least with sending NSDatas.


        My 2 questions:

        1) Is this a known issue? Or am I making a mistake somewhere else perhaps?

        2) If this is expected behavior, then does using the Resource sending APIs of Multipeer (instead of NSData) improve things?