sockets - streamsocket.connectasync results in access denied exception from hresult: 0x80070005 on windows phone 8.1? -
i tying connect 2 windows phone 8.1 devices via bluetooth. have 2 buttons, 1 discover peers, , second 1 connect.
i sure enabled internet(client & server) , proximity capabilities. here code: (frist button works fine)
private async void button_click(object sender, routedeventargs e) {
peerfinder.alternateidentities["bluetooth:paired"] = ""; var peerlist = await peerfinder.findallpeersasync(); if (peerlist.count > 0) { t1.text = peerlist[0].displayname + "\n"; } else t1.text= "no active peers"; } private async void button_click_1(object sender, routedeventargs e) { peerfinder.alternateidentities["bluetooth:paired"] = ""; var peerlist = await peerfinder.findallpeersasync(); if (peerlist.count > 0) t1.text = peerlist[0].displayname; try { peerfinder.stop(); streamsocket socket = new streamsocket(); await socket.connectasync(peerlist[0].hostname, "1");
Comments
Post a Comment