PeerFinder
Windows Phone 8 Proximity
APIのクラスを使用して、ピア ツー ピア ベースでデバイスを検出しようとしています。
Windows Phone 8 エミュレーターを使用して、Visual Studio 2013 でアプリを実行しています。私はPeerFinder
このようなクラスを使用します:
PeerFinder.AllowInfrastructure = true;
PeerFinder.Start();
この後、次のように他のピアを検出しようとします。
while (true)
{
try
{
var result = await PeerFinder.FindAllPeersAsync();
if (result.Count > 0)
System.Diagnostics.Debug.WriteLine("FOUND A PEER!");
}
catch (Exception ex)
System.Diagnostics.Debug.WriteLine("encountered error!!!");
}
FindAllPeersAsync() の行で発生するエラーは次のとおりです。
An exception of type 'System.Exception' occurred in mscorlib.ni.dll but was not handled in user code
Additional information: The device is not connected. (Exception from HRESULT: 0x8007048F)
問題は、実際のデバイスではなくエミュレーター内で実行されているという事実である可能性があると思いました。このようなネットワーキング (インフラストラクチャの有無にかかわらずピアツーピア) はエミュレーターで可能ですか、それとも何か忘れていますか?
どんな助けでも大歓迎です。ありがとう!