Jack Rogers
Jack Rogers

Reputation: 305

Force multipeer connection to close

Is there a way to end a (ios 7) multipeer connection? As in, not completely disconnect the local peer but instead just disable the connection with a specific peer?

Upvotes: 1

Views: 402

Answers (1)

ChrisH
ChrisH

Reputation: 4558

The only peer that you can disconnect from an MCSession is yourself, so you'd need to create a new session for each peer you connect to. You can keep those sessions in a dictionary with the connected peer's displayName property as a key, and when you want to disconnect a given peer, grab the relevant MCSession and send that session a disconnect message.

Upvotes: 1

Related Questions