Download presentation
Presentation is loading. Please wait.
Published byNickolas Gilmore Modified over 9 years ago
11
// OPTIONAL: Set some custom name to identify self to others. PeerFinder.displayName = myNameToDisplay; PeerFinder.ConnectionRequested += new TypedEventHandler (PeerConnectionRequested); PeerFinder.Start(); // Start advertising. private async void PeerConnectionRequested(object sender, ConnectionRequestedEventArgs args) { PeerInformation peer = args.PeerInformation; rootPage.NotifyUser("Connection requested from peer " + peer.DisplayName); //... Confirm as appropriate... StreamSocket socket = await PeerFinder.ConnectAsync(peer); }
12
using Windows.Networking.Proximity; IReadOnlyList peerList; // OPTIONAL: Set some custom name to identify self to others. Windows.Networking.Proximity.PeerFinder.displayName = myNameToDisplay; PeerFinder.Start(); // Must be done before FindAllPeersAsync(). peerList = await PeerFinder.FindAllPeersAsync(); // Scan for ~1 second. //... Use peerList[index].displayName to select index... StreamSocket socket = await PeerFinder.ConnectAsync(peerList[index]); PeerFinder.Stop(); // Done with discovery.
24
WebcamSocketEncrypt File Socket Mic File … Speakers Video control … Decrypt Compress Decompress …
25
StreamSocket connectedSocket; StorageFile file; // Get stream from file. var fileStream = await file.OpenAsync(FileAccessMode.ReadWrite); await RandomAccessStream.CopyAsync(connectedSocket.InputStream, fileStream);
26
StreamSocket connectedSocket; StorageFile file; // Get stream from file. var fileStream = await file.OpenAsync(FileAccessMode.ReadWrite); await RandomAccessStream.CopyAsync(connectedSocket.InputStream, fileStream);
27
StreamSocket connectedSocket; StorageFile file; // Get stream from file. var fileStream = await file.OpenAsync(FileAccessMode.ReadWrite); var decompressor = new Windows.Storage.Compression.Decompressor( connectedSocket.InputStream); await RandomAccessStream.CopyAsync(decompressor, fileStream);
28
StreamSocket connectedSocket; StorageFile file; // Get stream from file. var fileStream = await file.OpenAsync(FileAccessMode.ReadWrite); var provider = new Windows.Security.Cryptography.DataProtection. DataProtectionProvider(); await provider.UnprotectStreamAsync(connectedSocket.InputStream, fileStream);
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.