All Projects → jpsim → MPCMultipeerClient

jpsim / MPCMultipeerClient

Licence: MIT license
Wrapper around MultipeerConnectivity to simplify common use cases

Programming Languages

objective c
16641 projects - #2 most used programming language
shell
77523 projects
ruby
36898 projects - #4 most used programming language
C++
36643 projects - #6 most used programming language
c
50402 projects - #5 most used programming language

MPCMultipeerClient

Wrapper around MultipeerConnectivity to simplify common use cases.

VERY EARLY WORK IN PROGRESS, USE AT YOUR OWN PERIL.

Usage

See the remotecam demo project for more usage examples.

Advertise and respond to connect/disconnect/events

[MPCMultipeerClient advertiseWithServiceType:@"myservice"];
[MPCMultipeerClient onConnect:^(MCPeerID *peerID) {
    // Connected :)
}];
[MPCMultipeerClient onDisconnect:^(MCPeerID *peerID) {
    // Disconnected :(
}];
[MPCMultipeerClient onEvent:@"doTheThing" runBlock:^(MCPeerID *peerID, id object) {
    // Do the thing
}];

Browse and send events

[MPCMultipeerClient advertiseWithServiceType:@"myservice"];
[MPCMultipeerClient onConnect:^(MCPeerID *peerID) {
    [MPCMultipeerClient sendEvent:@"doTheThing" withObject:nil];
}];

TODO

  • Integrate NSStreams
  • Allow MCSessionSendDataUnreliable
  • Allow setting encryptionPreference
  • Master election
  • Use better unique peer ID than their displayName

License

MIT Licensed.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].