Multipeer connection failed when inviting a partner who stopped advertising

I have the following script:

  • Peer A is waiting for invitations to the user interface (call him WaitingVC). The object is MCNearbyServiceAdvertiserinitialized when the application starts, and the advertisement begins ( startAdvertisingPeer) when presented WaitingVC.
  • Peer B works with MCNearbyServiceBrowseras well as with the user interface (that is, does not use the one provided by Apple MCBrowserViewController).
  • Peer B finds Peer A ( browser:foundPeer:withDiscoveryInfo:).
  • Peer A , meanwhile, chooses a close WaitingVC. Advertisement stopped ( stopAdvertisingPeer).
  • A delay of a few seconds before Peer B finds out that command A is lost (i.e. called browser:lostPeer:).
  • If in these few seconds Peer B offers to invite Peer A (which is still available for Peer B ), Peer A (yes, the invitee who usually stopped advertising).
  • Peer B usually offers latency, and the problem does not occur.

A failure occurs in the queue com.apple.NSNetServices.tcplistener-queue. A dispatch_call_block_and_releasecrashes on release ( EXC_BREAKPOINT).

I really wonder if this is an error in the MC structure; or did I miss some cleaning procedure? Peer A does only the following:

  • : MCPeerID, ,
  • : MCNearbyServiceAdvertiser, , ,
  • WaitingVC: startAdvertisingPeer, stopAdvertisingPeer .

, , , . MCNearbyServiceAdvertiser MCPeerID WaitingVC , , WaitingVC, .

, ( , , ); . , symtpom ( "sync" , ).

Update:

MCAdvertiserAssistant, stop Peer A Peer B. , : http://techmaster.vn/2013/09/multipeer-connectivity-quick-tutorial/ - : Crash. , Apple...

+3
3

, , Dev Forums, . :

:

+5

advertiser:didReceiveInvitationFromPeer:withContext:invitationHandler:

, , blockHandler. ? B A crash, -, , .

0

. .

, , GKSession MCSession. , , . , .

0

All Articles