multipeer-connectivity

Peer-to-peer network over wifi in iOS

半世苍凉 提交于 2019-12-02 22:29:21
I've been at this for a few days now, and can't seem to find a solution. I want to create a peer to peer network over wifi on iOS. All open source code seems to be supporting running a server or being a client, but there's no code built to support being both - a peer. Is anybody aware of a way I can do this? darrinm iOS 7 adds the Multipeer Connectivity Framework for exactly this purpose. Have you thought of using Apple's GameKit framework? I've used it in the past for some simple communication between devices. It's really simple and can get you out of the gate quickly. This looks like a good

Swift Computed properties cannot be used in init?

旧巷老猫 提交于 2019-12-02 02:41:55
问题 I am trying to use MultipeerConnectivity framework with Swift. I have following properties: var peerId: MCPeerID?; let advertiser: MCNearbyServiceAdvertiser; let browser: MCNearbyServiceBrowser; var session: MCSession? .... In my init method, I initialize all my stored properties like this: init() { let defaults = NSUserDefaults.standardUserDefaults(); let dataToShow = defaults.dataForKey("kPeerID"); peerId = NSKeyedUnarchiver.unarchiveObjectWithData(dataToShow) as? MCPeerID; if !peerId {

Multipeer Connectivity: getting an invitation accepted (using built-in browser VC)

核能气质少年 提交于 2019-12-01 05:43:28
I'm trying to follow the WWDC talk to learn about the MultipeerConnectivity framework. After many false starts, the browser(s) show the peers, and invitations get issued. But when I press "Accept" on the peer device, the browser keeps showing "Connecting" without end. I thought that the MCBrowserViewController took care of the logic and I could relax until the browser's user pressed Cancel or Done, and the delegate method fired. I bet it's something obvious, but it's eluding me. Here's what I hope is the relevant code. I have it in the AppDelegate. NSLog statements in the various delegate

Multipeer Connectivity: getting an invitation accepted (using built-in browser VC)

拥有回忆 提交于 2019-12-01 03:56:58
问题 I'm trying to follow the WWDC talk to learn about the MultipeerConnectivity framework. After many false starts, the browser(s) show the peers, and invitations get issued. But when I press "Accept" on the peer device, the browser keeps showing "Connecting" without end. I thought that the MCBrowserViewController took care of the logic and I could relax until the browser's user pressed Cancel or Done, and the delegate method fired. I bet it's something obvious, but it's eluding me. Here's what I

iOS8 AVAudioEngine how to send microphone data over Multipeer Connectivity?

送分小仙女□ 提交于 2019-11-30 21:10:51
I want to send microphone audio data over Multipeer Connectivity (iOS 8) and play it through the speaker of the receiving peer. I've also setup the AVAudioEngine and I can hear the microphone data from the (upper) speaker output, but I don't know how to send AVAudioPCMBuffer over the network. Here's my code snippet: AVAudioInputNode *inputNode =[self.engine inputNode]; AVAudioMixerNode *mainMixer = [self.engine mainMixerNode]; [self.engine connect:inputNode to:mainMixer format:[inputNode inputFormatForBus:0]]; [mainMixer installTapOnBus:0 bufferSize:4096 format:[mainMixer outputFormatForBus:0]

Disable Nagle's algorithm for NSOutputStream

℡╲_俬逩灬. 提交于 2019-11-30 20:57:06
I am creating a multiplayer game using MPCF . You control a spacehip on the iPad using the iPhone. I am experiencing various amount of lag and latency and buffering/pauses at random times and intervals and have now landed on Apples Technical Q&A NW26 paper that talks about disabled the Nagle Algorithm. Im trying it out but my program keeps crashing and I dont understand why. It seem to be that CFWriteStreamCopyProperty always return NULL. - (void)stream:(NSStream *)stream handleEvent:(NSStreamEvent)eventCode { switch (eventCode) { case NSStreamEventOpenCompleted: // Trying to get a handle to

Accepting invitation multipeer connectivity

被刻印的时光 ゝ 提交于 2019-11-30 16:57:41
问题 I hope I am not violating NDA by posting this question. I am using the new multipeer connectivity to send using bluetooth some files to nearby devices. I have managed to send invitations, but I don't seem to get how to display a UIAlertView where the user can accept or decline the invite. Right now when a user sends, the file is automatically saved and there is no accept/decline alert. The code is: - (void) advertiser:(MCNearbyServiceAdvertiser *)advertiser didReceiveInvitationFromPeer:

The node js server is not loading my website files

天大地大妈咪最大 提交于 2019-11-30 09:41:45
问题 When I run node index.js the browser loads only the html, disregarding javascript, images, and css , and if I try to access a link it shows a blank plage: node.js Cannot GET /login.html, how do I fix that? var app = require('express')(); var http = require('http').Server(app); var io = require('socket.io')(http); var myList = new Array(); var i = 0; app.get('/', function(req, res){ res.sendFile(__dirname + '/index.html', {}); }); 回答1: You need show the error with your question and "/login

Use iPhone as a game controller in a tvOS app?

放肆的年华 提交于 2019-11-29 21:34:11
During the Apple TV announcement, the developers of Crossy Road demonstrated using an iPhone as a 2nd controller for an Apple tv game: http://www.macrumors.com/2015/09/09/cooperative-play-for-crossy-road/ My first thought was to implement this using the Multipeer Connectivity Framework . However, it's not supported on tvOS. Is there a good way to connect an iPhone to an Apple TV without Multipeer Connectivity? Update: It doesn't appear that I can use GameKit because GKPeerPickerController has been removed from GameKit on tvOS. vivianaranha You can try my library. I built this for my apps maybe

The node js server is not loading my website files

蓝咒 提交于 2019-11-29 16:17:42
When I run node index.js the browser loads only the html, disregarding javascript, images, and css , and if I try to access a link it shows a blank plage: node.js Cannot GET /login.html, how do I fix that? var app = require('express')(); var http = require('http').Server(app); var io = require('socket.io')(http); var myList = new Array(); var i = 0; app.get('/', function(req, res){ res.sendFile(__dirname + '/index.html', {}); }); You need show the error with your question and "/login.html" file? Or quick-fix, you can change your code as below: res.sendFile(__dirname + '/index.html', {}); to