Presentation is loading. Please wait.

Presentation is loading. Please wait.

// OPTIONAL: Set some custom name to identify self to others. PeerFinder.displayName = myNameToDisplay; PeerFinder.ConnectionRequested.

Similar presentations


Presentation on theme: "// OPTIONAL: Set some custom name to identify self to others. PeerFinder.displayName = myNameToDisplay; PeerFinder.ConnectionRequested."— Presentation transcript:

1

2

3

4

5

6

7

8

9

10

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.

13

14

15

16

17

18

19

20

21

22

23

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);

29

30

31

32

33

34

35

36

37

38

39

40

41

42


Download ppt "// OPTIONAL: Set some custom name to identify self to others. PeerFinder.displayName = myNameToDisplay; PeerFinder.ConnectionRequested."

Similar presentations


Ads by Google