SlideShare uma empresa Scribd logo
1 de 101
P2P on the local network
          getting your devices to play together




Peter Elst - Project Cocoon Multimedia - FFK11 April 6th 2011
What will we talk about?
What will we talk about?

‣   What is P2P and how does it work?
What will we talk about?

‣   What is P2P and how does it work?

‣   How can you set up P2P with Flash Player and AIR?
What will we talk about?

‣   What is P2P and how does it work?

‣   How can you set up P2P with Flash Player and AIR?

‣   What are the use cases for P2P?
What will we talk about?

‣   What is P2P and how does it work?

‣   How can you set up P2P with Flash Player and AIR?

‣   What are the use cases for P2P?

‣   Examples and technical walkthrough
What will we talk about?

‣   What is P2P and how does it work?

‣   How can you set up P2P with Flash Player and AIR?

‣   What are the use cases for P2P?

‣   Examples and technical walkthrough

‣   Questions & answers
What is P2P?
What is P2P?

‣   P2P enables direct communication between clients
What is P2P?

‣   P2P enables direct communication between clients

‣   Clients register themselves, from there on all communication
    happens directly between connected clients
What is P2P?

‣   P2P enables direct communication between clients

‣   Clients register themselves, from there on all communication
    happens directly between connected clients

‣   Huge decrease in bandwidth requirements
What is P2P?

‣   P2P enables direct communication between clients

‣   Clients register themselves, from there on all communication
    happens directly between connected clients

‣   Huge decrease in bandwidth requirements

‣   You can do P2P communication without a server (!)
Traditional network setup
Traditional network setup
Traditional network setup

‣   Centralized communication
Traditional network setup

‣   Centralized communication

‣   Single point of failure
Traditional network setup

‣   Centralized communication

‣   Single point of failure

‣   Bandwidth needs increases with
    each additional client
Traditional network setup

‣   Centralized communication

‣   Single point of failure

‣   Bandwidth needs increases with
    each additional client

‣   Not extremely scalable
P2P network setup
P2P network setup
P2P network setup

‣   Decentralized communication
P2P network setup

‣   Decentralized communication

‣   More robust network setup
P2P network setup

‣   Decentralized communication

‣   More robust network setup

‣   Additional clients makes
    network faster
P2P network setup

‣   Decentralized communication

‣   More robust network setup

‣   Additional clients makes
    network faster

‣   Easily scalable solution for
    multi-user applications
P2P concepts
P2P concepts

‣   NetGroup - P2P channel through which you communicate
P2P concepts

‣   NetGroup - P2P channel through which you communicate

‣   Peer ID - unique identifier given to each connected client
P2P concepts

‣   NetGroup - P2P channel through which you communicate

‣   Peer ID - unique identifier given to each connected client

‣   Posting - sending a message to clients in a netgroup
P2P concepts

‣   NetGroup - P2P channel through which you communicate

‣   Peer ID - unique identifier given to each connected client

‣   Posting - sending a message to clients in a netgroup

‣   Routing - sending a message to a client via neighbor peers
P2P concepts

‣   NetGroup - P2P channel through which you communicate

‣   Peer ID - unique identifier given to each connected client

‣   Posting - sending a message to clients in a netgroup

‣   Routing - sending a message to a client via neighbor peers

‣   Object replication - transferring of data using chunks
How do you set up P2P?
How do you set up P2P?

‣   Create a NetConnection instance
How do you set up P2P?

‣   Create a NetConnection instance

‣   Connect to an RTMFP server (if wanted)
How do you set up P2P?

‣   Create a NetConnection instance

‣   Connect to an RTMFP server (if wanted)

‣   Specify a GroupSpecifier and NetGroup instance
How do you set up P2P?

‣   Create a NetConnection instance

‣   Connect to an RTMFP server (if wanted)

‣   Specify a GroupSpecifier and NetGroup instance

‣   Listen for neighbor connect and disconnect events
How do you set up P2P?

‣   Create a NetConnection instance

‣   Connect to an RTMFP server (if wanted)

‣   Specify a GroupSpecifier and NetGroup instance

‣   Listen for neighbor connect and disconnect events

‣   Post message to NetGroup or route through nearest neighbor
How do you set up P2P?

‣   Create a NetConnection instance

‣   Connect to an RTMFP server (if wanted)

‣   Specify a GroupSpecifier and NetGroup instance

‣   Listen for neighbor connect and disconnect events

‣   Post message to NetGroup or route through nearest neighbor

‣   Handle file chunks for object replication
The boilerplate code 1/2
The boilerplate code 1/2
 nc = new NetConnection();
 nc.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);
 nc.connect("rtmfp:");
The boilerplate code 1/2
   nc = new NetConnection();
   nc.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);
   nc.connect("rtmfp:");



gSpec = new GroupSpecifier("myNetGroupID");
gSpec.postingEnabled = true;
gSpec.routingEnabled = true;
gSpec.ipMulticastMemberUpdatesEnabled = true;
gSpec.objectReplicationEnabled = true;
...
gSpec.addIPMulticastAddress("225.225.0.1:30303");
The boilerplate code 1/2
   nc = new NetConnection();
   nc.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);
   nc.connect("rtmfp:");



gSpec = new GroupSpecifier("myNetGroupID");
gSpec.postingEnabled = true;
gSpec.routingEnabled = true;
gSpec.ipMulticastMemberUpdatesEnabled = true;
gSpec.objectReplicationEnabled = true;
...
gSpec.addIPMulticastAddress("225.225.0.1:30303");		   	



group = new NetGroup(nc, gSpec.groupspecWithAuthorizations());	
group.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);
The boilerplate code 2/2
The boilerplate code 2/2
 private function onNetStatus(evt:NetStatusEvent):void {
   switch (evt.info.code) {
     case "NetConnection.Connect.Success":
       // netconnection successful
     break;
     case "NetGroup.Neighbor.Connect":
       // client joined the netgroup
     break;
     case "NetGroup.Neighbor.Disconnect":
       // client left the netgroup
     break;
     case "NetGroup.Posting.Notify":
       // message was posted to the netgroup
     break;
     ...
   }
 }
Mobile clients - AIR for Android
Mobile clients - AIR for Android
Mobile clients - AIR for Android

‣   AIR for Android allows us to run desktop AIR files and take
    advantage of additional mobile specific features such as the
    accelerometer, geolocation,...
Mobile clients - AIR for Android

‣   AIR for Android allows us to run desktop AIR files and take
    advantage of additional mobile specific features such as the
    accelerometer, geolocation,...

‣   Almost all desktop APIs are supported
Mobile clients - AIR for Android

‣   AIR for Android allows us to run desktop AIR files and take
    advantage of additional mobile specific features such as the
    accelerometer, geolocation,...

‣   Almost all desktop APIs are supported

‣   Its a lot of fun to develop for!
Mobile clients - compiling to iOS
Mobile clients - compiling to iOS
Mobile clients - compiling to iOS

‣   AIR can cross-compile to native iOS binaries
Mobile clients - compiling to iOS

‣   AIR can cross-compile to native iOS binaries

‣   Apple started allowing third party cross-compiled applications
    back into their app store
Mobile clients - compiling to iOS

‣   AIR can cross-compile to native iOS binaries

‣   Apple started allowing third party cross-compiled applications
    back into their app store

‣   Compiled binaries generally have a larger file size
Accelerometer API
Accelerometer API
if(Accelerometer.isSupported) {
  var acc:Accelerometer = new Accelerometer();
  acc.setRequestedUpdateInterval(500);
  acc.addEventListener(AccelerometerEvent.UPDATE, update);
}



private function update(evt:AccelerometerEvent):void {
  trace("x acceleration: "+evt.accelerationX);
  trace("y acceleration: "+evt.accelerationY);
  trace("z acceleration: "+evt.accelerationZ);
}
Geolocation API
Geolocation API
if(Geolocation.isSupported){
  var geo:Geolocation = new Geolocation();
  geo.setRequestedUpdateInterval(10000);
  geo.addEventListener(GeolocationEvent.UPDATE, update);
}



private function update(evt:GeolocationEvent):void {
  trace("latitude: "+evt.latitude);
  trace("longitude: "+evt.longitude);
  trace("speed: "+evt.speed);
}
Use cases - Gaming
Use cases - Gaming

‣   Sensor data can turn any device into a game controller
Use cases - Gaming

‣   Sensor data can turn any device into a game controller

‣   High scores and other game data can be synchronized and
    persisted on the mobile device
Use cases - Gaming

‣   Sensor data can turn any device into a game controller

‣   High scores and other game data can be synchronized and
    persisted on the mobile device

‣   Practically everyone carries a phone so can immediately join in
Use cases - E-Learning
Use cases - E-Learning

‣   Students are increasingly using devices for their studies
Use cases - E-Learning

‣   Students are increasingly using devices for their studies

‣   Connected class rooms with shared whiteboards and
    collaborative tasks
Use cases - E-Learning

‣   Students are increasingly using devices for their studies

‣   Connected class rooms with shared whiteboards and
    collaborative tasks

‣   Teachers can get realtime data and statistics on how their
    students perform on particular exercises
Use cases - Sensor input
Use cases - Sensor input

‣   Mobile devices can provide additional input to your computer
Use cases - Sensor input

‣   Mobile devices can provide additional input to your computer

‣   Software can take advantage of multi-touch, accelerometer,
    geolocation data and camera access
Use cases - Sensor input

‣   Mobile devices can provide additional input to your computer

‣   Software can take advantage of multi-touch, accelerometer,
    geolocation data and camera access

‣   Mobile device becomes a second screen and helps with your
    productivity
Introducing Cocoon P2P
Introducing Cocoon P2P
Introducing Cocoon P2P
        ‣   Simple open source library focussed on
            local IP multicast with Flash Player 10.1
            or later and AIR across devices
Introducing Cocoon P2P
        ‣   Simple open source library focussed on
            local IP multicast with Flash Player 10.1
            or later and AIR across devices

        ‣   Very easy to use, avoid boilerplate code
Introducing Cocoon P2P
         ‣   Simple open source library focussed on
             local IP multicast with Flash Player 10.1
             or later and AIR across devices

         ‣   Very easy to use, avoid boilerplate code

         ‣   Early support for file transfer, video
             streaming and accelerometer


       cocoon-p2p.googlecode.com
Example - device discovery
Example - device discovery

    <p2p:LocalNetworkDiscovery id="channel" clientName="FFK11 - beyond tellerrand" /
    >

    <s:List width="80%" height="200"
         horizontalCenter="0" verticalCenter="0"
	   	   dataProvider="{channel.clients}" labelField="clientName" />
Example - messaging
Example - messaging

   <p2p:LocalNetworkDiscovery id="channel"
                           clientAdded="onClientAdded(event)"
                           clientRemoved="onClientRemoved(event)"
                           dataReceived="onDataReceived(event)"
                           loopback="true" />




channel.sendMessageToAll("Hello everyone!");
channel.sendMessageToClient("Hello you!", peerID);
Example - photo sharing
Example - photo sharing

   <p2p:LocalNetworkDiscovery id="channel"
                           dataReceived="onDataReceived(event)"
                           fileComplete="onFileComplete(event)" />




var myFile:File = File.desktopDirectory.resolvePath("image.jpg");

channel.sendFileToAll(myFile);
channel.sendFileToClient(myFile, peerID);
Example - multiplayer game
Example - multiplayer game

•   <p2p:LocalNetworkDiscovery id="channel"
                             accelerometerInterval="1000" />



<p2p:LocalNetworkDiscovery id="channel"
                           accelerometerUpdate="onAccelerometer(event)" />




private function onAccelerometer(evt:AccelerometerEvent):void {
  trace("x acceleration: "+evt.accelerationX);
  trace("y acceleration: "+evt.accelerationY);
  trace("z acceleration: "+evt.accelerationZ);
}
Example - video streaming
Example - video streaming

•   <p2p:LocalNetworkDiscovery id="channel"
                             videoStream="{cam}" />




var cam:Camera = Camera.getCamera();

var video:Video = new Video(320,240);
video.attachCamera({channel.videoStream});
Security dialog
Security dialog
Security dialog

‣   Everything covered here does not require Adobe AIR
Security dialog

‣   Everything covered here does not require Adobe AIR

‣   Using P2P in Flash Player will prompt a security dialog
Security dialog

‣   Everything covered here does not require Adobe AIR

‣   Using P2P in Flash Player will prompt a security dialog

‣   User can control whether or not
    to allow peer assisted networking
Security dialog

‣   Everything covered here does not require Adobe AIR

‣   Using P2P in Flash Player will prompt a security dialog

‣   User can control whether or not
    to allow peer assisted networking

‣   For AIR applications this is allowed
    by default without user interaction
Summary
Summary

‣   P2P is available from Flash Player 10.1 onwards and in Adobe
    AIR across devices (including iOS, BlackBerry PlayBook,
    Google TV,...)
Summary

‣   P2P is available from Flash Player 10.1 onwards and in Adobe
    AIR across devices (including iOS, BlackBerry PlayBook,
    Google TV,...)

‣   You can use this feature for connecting local devices without
    the need for a Flash Media Server
Summary

‣   P2P is available from Flash Player 10.1 onwards and in Adobe
    AIR across devices (including iOS, BlackBerry PlayBook,
    Google TV,...)

‣   You can use this feature for connecting local devices without
    the need for a Flash Media Server

‣   Devices need to be on the same wifi network and IP multicast
    must not be blocked on the router
Resources
Resources

‣   Tom Krcha - flashrealtime.com
Resources

‣   Tom Krcha - flashrealtime.com

‣   HydraP2P - github.com/devboy/HydraP2P
Resources

‣   Tom Krcha - flashrealtime.com

‣   HydraP2P - github.com/devboy/HydraP2P

‣   Cirrus (formerly Stratus) - labs.adobe.com/technologies/cirrus
Questions?
Questions?




Peter Elst

e-mail    info@peterelst.com
twitter    @peterelst
blog      www.peterelst.com
company   www.project-cocoon.com
Thank you!




Peter Elst

e-mail    info@peterelst.com
twitter    @peterelst
blog      www.peterelst.com
company   www.project-cocoon.com

Mais conteúdo relacionado

Mais procurados

B 2 line game cloud - our personal ec2
B 2 line game cloud - our personal ec2B 2 line game cloud - our personal ec2
B 2 line game cloud - our personal ec2
LINE Corporation
 
KazooCon 2014 - Kazoo Scalability
KazooCon 2014 - Kazoo ScalabilityKazooCon 2014 - Kazoo Scalability
KazooCon 2014 - Kazoo Scalability
2600Hz
 

Mais procurados (18)

Rethinking Cloud Proxies
Rethinking Cloud ProxiesRethinking Cloud Proxies
Rethinking Cloud Proxies
 
What's New in HTTP/2
What's New in HTTP/2What's New in HTTP/2
What's New in HTTP/2
 
Altitude San Francisco 2018: HTTP/2 Tales: Discovery and Woe
Altitude San Francisco 2018: HTTP/2 Tales: Discovery and WoeAltitude San Francisco 2018: HTTP/2 Tales: Discovery and Woe
Altitude San Francisco 2018: HTTP/2 Tales: Discovery and Woe
 
Altitude San Francisco 2018: HTTP Invalidation Workshop
Altitude San Francisco 2018: HTTP Invalidation WorkshopAltitude San Francisco 2018: HTTP Invalidation Workshop
Altitude San Francisco 2018: HTTP Invalidation Workshop
 
Exactly Once Delivery with Kafka - JOTB2020 Mini Session
Exactly Once Delivery with Kafka - JOTB2020 Mini SessionExactly Once Delivery with Kafka - JOTB2020 Mini Session
Exactly Once Delivery with Kafka - JOTB2020 Mini Session
 
WebRTC Reborn - Cloud Expo / WebRTC Summit
WebRTC Reborn - Cloud Expo / WebRTC SummitWebRTC Reborn - Cloud Expo / WebRTC Summit
WebRTC Reborn - Cloud Expo / WebRTC Summit
 
Altitude San Francisco 2018: We Own Our Destiny
Altitude San Francisco 2018: We Own Our DestinyAltitude San Francisco 2018: We Own Our Destiny
Altitude San Francisco 2018: We Own Our Destiny
 
Astricon 2016 - Scaling ARI and Production
Astricon 2016 - Scaling ARI and ProductionAstricon 2016 - Scaling ARI and Production
Astricon 2016 - Scaling ARI and Production
 
B 2 line game cloud - our personal ec2
B 2 line game cloud - our personal ec2B 2 line game cloud - our personal ec2
B 2 line game cloud - our personal ec2
 
Altitude SF 2017: Logging at the edge
Altitude SF 2017: Logging at the edgeAltitude SF 2017: Logging at the edge
Altitude SF 2017: Logging at the edge
 
Meetups - The Oracle Ace Way
Meetups - The Oracle Ace WayMeetups - The Oracle Ace Way
Meetups - The Oracle Ace Way
 
KazooCon 2014 - Kazoo Scalability
KazooCon 2014 - Kazoo ScalabilityKazooCon 2014 - Kazoo Scalability
KazooCon 2014 - Kazoo Scalability
 
Open sourcing a successful internal project - Reversim 2021
Open sourcing a successful internal project - Reversim 2021Open sourcing a successful internal project - Reversim 2021
Open sourcing a successful internal project - Reversim 2021
 
No REST - Architecting Real-time Bulk Async APIs
No REST - Architecting Real-time Bulk Async APIsNo REST - Architecting Real-time Bulk Async APIs
No REST - Architecting Real-time Bulk Async APIs
 
Broadband India Forum Session on IPv6: The Post-IPocalypse Internet
Broadband India Forum Session on IPv6: The Post-IPocalypse InternetBroadband India Forum Session on IPv6: The Post-IPocalypse Internet
Broadband India Forum Session on IPv6: The Post-IPocalypse Internet
 
Killer Docker Workflows for Development
Killer Docker Workflows for DevelopmentKiller Docker Workflows for Development
Killer Docker Workflows for Development
 
Programming for the Internet of Things
Programming for the Internet of ThingsProgramming for the Internet of Things
Programming for the Internet of Things
 
Using PHP Functions! (Not those functions, Google Cloud Functions)
Using PHP Functions! (Not those functions, Google Cloud Functions)Using PHP Functions! (Not those functions, Google Cloud Functions)
Using PHP Functions! (Not those functions, Google Cloud Functions)
 

Destaque

My Final Project
My Final ProjectMy Final Project
My Final Project
askkathir
 
FYP: Peer-to-Peer Communications Framework on Android Platform
FYP: Peer-to-Peer Communications Framework on Android PlatformFYP: Peer-to-Peer Communications Framework on Android Platform
FYP: Peer-to-Peer Communications Framework on Android Platform
webuiltit
 
Mobile ad hoc networking: imperatives and challenges
Mobile ad hoc networking: imperatives and challengesMobile ad hoc networking: imperatives and challenges
Mobile ad hoc networking: imperatives and challenges
guest1b5f71
 
Social Networking Site in JAVA
Social Networking Site in JAVASocial Networking Site in JAVA
Social Networking Site in JAVA
PAS Softech Pvt. Ltd.
 
Mobile Ad hoc Networks
Mobile Ad hoc NetworksMobile Ad hoc Networks
Mobile Ad hoc Networks
Jagdeep Singh
 

Destaque (20)

Peer To Peer Networking
Peer To Peer NetworkingPeer To Peer Networking
Peer To Peer Networking
 
Peer-to-Peer Systems
Peer-to-Peer SystemsPeer-to-Peer Systems
Peer-to-Peer Systems
 
My Final Project
My Final ProjectMy Final Project
My Final Project
 
Android Application Development of NFC Peer-to-Peer Mode
Android Application Development of NFC Peer-to-Peer ModeAndroid Application Development of NFC Peer-to-Peer Mode
Android Application Development of NFC Peer-to-Peer Mode
 
FYP: Peer-to-Peer Communications Framework on Android Platform
FYP: Peer-to-Peer Communications Framework on Android PlatformFYP: Peer-to-Peer Communications Framework on Android Platform
FYP: Peer-to-Peer Communications Framework on Android Platform
 
Mobile ad hoc networking: imperatives and challenges
Mobile ad hoc networking: imperatives and challengesMobile ad hoc networking: imperatives and challenges
Mobile ad hoc networking: imperatives and challenges
 
Ubiquiti Networks
Ubiquiti NetworksUbiquiti Networks
Ubiquiti Networks
 
Manet - The Art of Networking without a Network
Manet - The Art of Networking without a NetworkManet - The Art of Networking without a Network
Manet - The Art of Networking without a Network
 
Communications
CommunicationsCommunications
Communications
 
Ubnt
UbntUbnt
Ubnt
 
Synopsis on android application
Synopsis on android applicationSynopsis on android application
Synopsis on android application
 
Android Synopsis
Android SynopsisAndroid Synopsis
Android Synopsis
 
Social Networking Site in JAVA
Social Networking Site in JAVASocial Networking Site in JAVA
Social Networking Site in JAVA
 
Wifi direct p2p app
Wifi direct p2p appWifi direct p2p app
Wifi direct p2p app
 
Android internals 10 - Debugging/Profiling, Bluetooth/WiFI/RIL (rev_1.1)
Android internals 10 - Debugging/Profiling, Bluetooth/WiFI/RIL (rev_1.1)Android internals 10 - Debugging/Profiling, Bluetooth/WiFI/RIL (rev_1.1)
Android internals 10 - Debugging/Profiling, Bluetooth/WiFI/RIL (rev_1.1)
 
WebRTC + Socket.io: building a skype-like video chat with native javascript
WebRTC + Socket.io: building a skype-like video chat with native javascriptWebRTC + Socket.io: building a skype-like video chat with native javascript
WebRTC + Socket.io: building a skype-like video chat with native javascript
 
Social Networking Project (website) full documentation
Social Networking Project (website) full documentation Social Networking Project (website) full documentation
Social Networking Project (website) full documentation
 
Ad-Hoc Networks
Ad-Hoc NetworksAd-Hoc Networks
Ad-Hoc Networks
 
Mobile Ad hoc Networks
Mobile Ad hoc NetworksMobile Ad hoc Networks
Mobile Ad hoc Networks
 
Agile Project Management - An introduction to Agile and the new PMI-ACP
Agile Project Management - An introduction to Agile and the new PMI-ACPAgile Project Management - An introduction to Agile and the new PMI-ACP
Agile Project Management - An introduction to Agile and the new PMI-ACP
 

Semelhante a P2P on the local network

P2P with Flash Player 10.1
P2P with Flash Player 10.1P2P with Flash Player 10.1
P2P with Flash Player 10.1
Peter Elst
 
Flash Camp Chennai - P2P with Flash Player 10.1
Flash Camp Chennai - P2P with Flash Player 10.1Flash Camp Chennai - P2P with Flash Player 10.1
Flash Camp Chennai - P2P with Flash Player 10.1
RIA RUI Society
 
Running in the Cloud - First Belgian Azure project
Running in the Cloud - First Belgian Azure projectRunning in the Cloud - First Belgian Azure project
Running in the Cloud - First Belgian Azure project
Maarten Balliauw
 
Running in the Cloud - First Belgian Azure project
Running in the Cloud - First Belgian Azure projectRunning in the Cloud - First Belgian Azure project
Running in the Cloud - First Belgian Azure project
Maarten Balliauw
 
Www ccnav5 net_ccna_1_chapter_3_v5_0_exam_answers_2014
Www ccnav5 net_ccna_1_chapter_3_v5_0_exam_answers_2014Www ccnav5 net_ccna_1_chapter_3_v5_0_exam_answers_2014
Www ccnav5 net_ccna_1_chapter_3_v5_0_exam_answers_2014
Đồng Quốc Vương
 

Semelhante a P2P on the local network (20)

P2P with Flash Player 10.1
P2P with Flash Player 10.1P2P with Flash Player 10.1
P2P with Flash Player 10.1
 
Flash Camp Chennai - P2P with Flash Player 10.1
Flash Camp Chennai - P2P with Flash Player 10.1Flash Camp Chennai - P2P with Flash Player 10.1
Flash Camp Chennai - P2P with Flash Player 10.1
 
Network Automation - Interconnection tools
Network Automation - Interconnection toolsNetwork Automation - Interconnection tools
Network Automation - Interconnection tools
 
WebRTC: A front-end perspective
WebRTC: A front-end perspectiveWebRTC: A front-end perspective
WebRTC: A front-end perspective
 
Introduction to Puppet Enterprise 10/03/2018
Introduction to Puppet Enterprise 10/03/2018Introduction to Puppet Enterprise 10/03/2018
Introduction to Puppet Enterprise 10/03/2018
 
Making awesome apps
Making awesome appsMaking awesome apps
Making awesome apps
 
P2P for mobile devices
P2P for mobile devicesP2P for mobile devices
P2P for mobile devices
 
Running in the Cloud - First Belgian Azure project
Running in the Cloud - First Belgian Azure projectRunning in the Cloud - First Belgian Azure project
Running in the Cloud - First Belgian Azure project
 
Running in the Cloud - First Belgian Azure project
Running in the Cloud - First Belgian Azure projectRunning in the Cloud - First Belgian Azure project
Running in the Cloud - First Belgian Azure project
 
WP7 & Azure
WP7 & AzureWP7 & Azure
WP7 & Azure
 
Python for IoT, A return of experience
Python for IoT, A return of experiencePython for IoT, A return of experience
Python for IoT, A return of experience
 
Using Python for IoT: a return of experience, Alexandre Abadie
Using Python for IoT: a return of experience, Alexandre AbadieUsing Python for IoT: a return of experience, Alexandre Abadie
Using Python for IoT: a return of experience, Alexandre Abadie
 
From the internet of things to the web of things course
From the internet of things to the web of things courseFrom the internet of things to the web of things course
From the internet of things to the web of things course
 
Open stack gbp final sn-4-slideshare
Open stack gbp final sn-4-slideshareOpen stack gbp final sn-4-slideshare
Open stack gbp final sn-4-slideshare
 
VSCP & Friends Presentation Eindhoven
VSCP & Friends  Presentation EindhovenVSCP & Friends  Presentation Eindhoven
VSCP & Friends Presentation Eindhoven
 
.NET Cloud-Native Bootcamp
.NET Cloud-Native Bootcamp.NET Cloud-Native Bootcamp
.NET Cloud-Native Bootcamp
 
Fish Cam.pptx
Fish Cam.pptxFish Cam.pptx
Fish Cam.pptx
 
DEVNET-1010 Using Cisco pxGrid for Security Platform Integration
DEVNET-1010	Using Cisco pxGrid for Security Platform IntegrationDEVNET-1010	Using Cisco pxGrid for Security Platform Integration
DEVNET-1010 Using Cisco pxGrid for Security Platform Integration
 
GCCP Session 3
GCCP Session 3GCCP Session 3
GCCP Session 3
 
Www ccnav5 net_ccna_1_chapter_3_v5_0_exam_answers_2014
Www ccnav5 net_ccna_1_chapter_3_v5_0_exam_answers_2014Www ccnav5 net_ccna_1_chapter_3_v5_0_exam_answers_2014
Www ccnav5 net_ccna_1_chapter_3_v5_0_exam_answers_2014
 

Mais de Peter Elst

Big boys and their litl toys
Big boys and their litl toysBig boys and their litl toys
Big boys and their litl toys
Peter Elst
 
FATC - AIR 2.0 workshop
FATC - AIR 2.0 workshopFATC - AIR 2.0 workshop
FATC - AIR 2.0 workshop
Peter Elst
 
Introduction to AS3Signals
Introduction to AS3SignalsIntroduction to AS3Signals
Introduction to AS3Signals
Peter Elst
 
The Secret Life of a Flash Freelancer
The Secret Life of a Flash FreelancerThe Secret Life of a Flash Freelancer
The Secret Life of a Flash Freelancer
Peter Elst
 
Getting Creative with Adobe AIR
Getting Creative with Adobe AIRGetting Creative with Adobe AIR
Getting Creative with Adobe AIR
Peter Elst
 
Creative Programming in ActionScript 3.0
Creative Programming in ActionScript 3.0Creative Programming in ActionScript 3.0
Creative Programming in ActionScript 3.0
Peter Elst
 
Introduction to SQLite in Adobe AIR 1.5
Introduction to SQLite in Adobe AIR 1.5Introduction to SQLite in Adobe AIR 1.5
Introduction to SQLite in Adobe AIR 1.5
Peter Elst
 
RIA meets Desktop
RIA meets DesktopRIA meets Desktop
RIA meets Desktop
Peter Elst
 
Object-Oriented ActionScript 3.0
Object-Oriented ActionScript 3.0Object-Oriented ActionScript 3.0
Object-Oriented ActionScript 3.0
Peter Elst
 
The Evolution of the Flash Platform
The Evolution of the Flash PlatformThe Evolution of the Flash Platform
The Evolution of the Flash Platform
Peter Elst
 
SQLite in Adobe AIR
SQLite in Adobe AIRSQLite in Adobe AIR
SQLite in Adobe AIR
Peter Elst
 

Mais de Peter Elst (17)

Big boys and their litl toys
Big boys and their litl toysBig boys and their litl toys
Big boys and their litl toys
 
Yes, you can do that with AIR 2.0
Yes, you can do that with AIR 2.0Yes, you can do that with AIR 2.0
Yes, you can do that with AIR 2.0
 
FATC - AIR 2.0 workshop
FATC - AIR 2.0 workshopFATC - AIR 2.0 workshop
FATC - AIR 2.0 workshop
 
Developing with Adobe AIR
Developing with Adobe AIRDeveloping with Adobe AIR
Developing with Adobe AIR
 
Introduction to AS3Signals
Introduction to AS3SignalsIntroduction to AS3Signals
Introduction to AS3Signals
 
The Secret Life of a Flash Freelancer
The Secret Life of a Flash FreelancerThe Secret Life of a Flash Freelancer
The Secret Life of a Flash Freelancer
 
Getting Creative with Adobe AIR
Getting Creative with Adobe AIRGetting Creative with Adobe AIR
Getting Creative with Adobe AIR
 
Introduction to SQLite in Adobe AIR
Introduction to SQLite in Adobe AIRIntroduction to SQLite in Adobe AIR
Introduction to SQLite in Adobe AIR
 
Creative Programming in ActionScript 3.0
Creative Programming in ActionScript 3.0Creative Programming in ActionScript 3.0
Creative Programming in ActionScript 3.0
 
Introduction to SQLite in Adobe AIR 1.5
Introduction to SQLite in Adobe AIR 1.5Introduction to SQLite in Adobe AIR 1.5
Introduction to SQLite in Adobe AIR 1.5
 
RIA meets Desktop
RIA meets DesktopRIA meets Desktop
RIA meets Desktop
 
Object-Oriented ActionScript 3.0
Object-Oriented ActionScript 3.0Object-Oriented ActionScript 3.0
Object-Oriented ActionScript 3.0
 
The Evolution of the Flash Platform
The Evolution of the Flash PlatformThe Evolution of the Flash Platform
The Evolution of the Flash Platform
 
SQLite in Adobe AIR
SQLite in Adobe AIRSQLite in Adobe AIR
SQLite in Adobe AIR
 
Introduction to SQLite in Adobe AIR
Introduction to SQLite in Adobe AIRIntroduction to SQLite in Adobe AIR
Introduction to SQLite in Adobe AIR
 
RIA meets Desktop
RIA meets DesktopRIA meets Desktop
RIA meets Desktop
 
SkillsMatter - In-the-Brain session - What's new in ActionScript 3.0
SkillsMatter - In-the-Brain session - What's new in ActionScript 3.0SkillsMatter - In-the-Brain session - What's new in ActionScript 3.0
SkillsMatter - In-the-Brain session - What's new in ActionScript 3.0
 

Último

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 

P2P on the local network

  • 1. P2P on the local network getting your devices to play together Peter Elst - Project Cocoon Multimedia - FFK11 April 6th 2011
  • 2. What will we talk about?
  • 3. What will we talk about? ‣ What is P2P and how does it work?
  • 4. What will we talk about? ‣ What is P2P and how does it work? ‣ How can you set up P2P with Flash Player and AIR?
  • 5. What will we talk about? ‣ What is P2P and how does it work? ‣ How can you set up P2P with Flash Player and AIR? ‣ What are the use cases for P2P?
  • 6. What will we talk about? ‣ What is P2P and how does it work? ‣ How can you set up P2P with Flash Player and AIR? ‣ What are the use cases for P2P? ‣ Examples and technical walkthrough
  • 7. What will we talk about? ‣ What is P2P and how does it work? ‣ How can you set up P2P with Flash Player and AIR? ‣ What are the use cases for P2P? ‣ Examples and technical walkthrough ‣ Questions & answers
  • 9. What is P2P? ‣ P2P enables direct communication between clients
  • 10. What is P2P? ‣ P2P enables direct communication between clients ‣ Clients register themselves, from there on all communication happens directly between connected clients
  • 11. What is P2P? ‣ P2P enables direct communication between clients ‣ Clients register themselves, from there on all communication happens directly between connected clients ‣ Huge decrease in bandwidth requirements
  • 12. What is P2P? ‣ P2P enables direct communication between clients ‣ Clients register themselves, from there on all communication happens directly between connected clients ‣ Huge decrease in bandwidth requirements ‣ You can do P2P communication without a server (!)
  • 15. Traditional network setup ‣ Centralized communication
  • 16. Traditional network setup ‣ Centralized communication ‣ Single point of failure
  • 17. Traditional network setup ‣ Centralized communication ‣ Single point of failure ‣ Bandwidth needs increases with each additional client
  • 18. Traditional network setup ‣ Centralized communication ‣ Single point of failure ‣ Bandwidth needs increases with each additional client ‣ Not extremely scalable
  • 21. P2P network setup ‣ Decentralized communication
  • 22. P2P network setup ‣ Decentralized communication ‣ More robust network setup
  • 23. P2P network setup ‣ Decentralized communication ‣ More robust network setup ‣ Additional clients makes network faster
  • 24. P2P network setup ‣ Decentralized communication ‣ More robust network setup ‣ Additional clients makes network faster ‣ Easily scalable solution for multi-user applications
  • 26. P2P concepts ‣ NetGroup - P2P channel through which you communicate
  • 27. P2P concepts ‣ NetGroup - P2P channel through which you communicate ‣ Peer ID - unique identifier given to each connected client
  • 28. P2P concepts ‣ NetGroup - P2P channel through which you communicate ‣ Peer ID - unique identifier given to each connected client ‣ Posting - sending a message to clients in a netgroup
  • 29. P2P concepts ‣ NetGroup - P2P channel through which you communicate ‣ Peer ID - unique identifier given to each connected client ‣ Posting - sending a message to clients in a netgroup ‣ Routing - sending a message to a client via neighbor peers
  • 30. P2P concepts ‣ NetGroup - P2P channel through which you communicate ‣ Peer ID - unique identifier given to each connected client ‣ Posting - sending a message to clients in a netgroup ‣ Routing - sending a message to a client via neighbor peers ‣ Object replication - transferring of data using chunks
  • 31. How do you set up P2P?
  • 32. How do you set up P2P? ‣ Create a NetConnection instance
  • 33. How do you set up P2P? ‣ Create a NetConnection instance ‣ Connect to an RTMFP server (if wanted)
  • 34. How do you set up P2P? ‣ Create a NetConnection instance ‣ Connect to an RTMFP server (if wanted) ‣ Specify a GroupSpecifier and NetGroup instance
  • 35. How do you set up P2P? ‣ Create a NetConnection instance ‣ Connect to an RTMFP server (if wanted) ‣ Specify a GroupSpecifier and NetGroup instance ‣ Listen for neighbor connect and disconnect events
  • 36. How do you set up P2P? ‣ Create a NetConnection instance ‣ Connect to an RTMFP server (if wanted) ‣ Specify a GroupSpecifier and NetGroup instance ‣ Listen for neighbor connect and disconnect events ‣ Post message to NetGroup or route through nearest neighbor
  • 37. How do you set up P2P? ‣ Create a NetConnection instance ‣ Connect to an RTMFP server (if wanted) ‣ Specify a GroupSpecifier and NetGroup instance ‣ Listen for neighbor connect and disconnect events ‣ Post message to NetGroup or route through nearest neighbor ‣ Handle file chunks for object replication
  • 39. The boilerplate code 1/2 nc = new NetConnection(); nc.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus); nc.connect("rtmfp:");
  • 40. The boilerplate code 1/2 nc = new NetConnection(); nc.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus); nc.connect("rtmfp:"); gSpec = new GroupSpecifier("myNetGroupID"); gSpec.postingEnabled = true; gSpec.routingEnabled = true; gSpec.ipMulticastMemberUpdatesEnabled = true; gSpec.objectReplicationEnabled = true; ... gSpec.addIPMulticastAddress("225.225.0.1:30303");
  • 41. The boilerplate code 1/2 nc = new NetConnection(); nc.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus); nc.connect("rtmfp:"); gSpec = new GroupSpecifier("myNetGroupID"); gSpec.postingEnabled = true; gSpec.routingEnabled = true; gSpec.ipMulticastMemberUpdatesEnabled = true; gSpec.objectReplicationEnabled = true; ... gSpec.addIPMulticastAddress("225.225.0.1:30303"); group = new NetGroup(nc, gSpec.groupspecWithAuthorizations()); group.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);
  • 43. The boilerplate code 2/2 private function onNetStatus(evt:NetStatusEvent):void { switch (evt.info.code) { case "NetConnection.Connect.Success": // netconnection successful break; case "NetGroup.Neighbor.Connect": // client joined the netgroup break; case "NetGroup.Neighbor.Disconnect": // client left the netgroup break; case "NetGroup.Posting.Notify": // message was posted to the netgroup break; ... } }
  • 44. Mobile clients - AIR for Android
  • 45. Mobile clients - AIR for Android
  • 46. Mobile clients - AIR for Android ‣ AIR for Android allows us to run desktop AIR files and take advantage of additional mobile specific features such as the accelerometer, geolocation,...
  • 47. Mobile clients - AIR for Android ‣ AIR for Android allows us to run desktop AIR files and take advantage of additional mobile specific features such as the accelerometer, geolocation,... ‣ Almost all desktop APIs are supported
  • 48. Mobile clients - AIR for Android ‣ AIR for Android allows us to run desktop AIR files and take advantage of additional mobile specific features such as the accelerometer, geolocation,... ‣ Almost all desktop APIs are supported ‣ Its a lot of fun to develop for!
  • 49. Mobile clients - compiling to iOS
  • 50. Mobile clients - compiling to iOS
  • 51. Mobile clients - compiling to iOS ‣ AIR can cross-compile to native iOS binaries
  • 52. Mobile clients - compiling to iOS ‣ AIR can cross-compile to native iOS binaries ‣ Apple started allowing third party cross-compiled applications back into their app store
  • 53. Mobile clients - compiling to iOS ‣ AIR can cross-compile to native iOS binaries ‣ Apple started allowing third party cross-compiled applications back into their app store ‣ Compiled binaries generally have a larger file size
  • 55. Accelerometer API if(Accelerometer.isSupported) { var acc:Accelerometer = new Accelerometer(); acc.setRequestedUpdateInterval(500);   acc.addEventListener(AccelerometerEvent.UPDATE, update); } private function update(evt:AccelerometerEvent):void { trace("x acceleration: "+evt.accelerationX); trace("y acceleration: "+evt.accelerationY); trace("z acceleration: "+evt.accelerationZ); }
  • 57. Geolocation API if(Geolocation.isSupported){ var geo:Geolocation = new Geolocation(); geo.setRequestedUpdateInterval(10000);   geo.addEventListener(GeolocationEvent.UPDATE, update); } private function update(evt:GeolocationEvent):void { trace("latitude: "+evt.latitude); trace("longitude: "+evt.longitude); trace("speed: "+evt.speed); }
  • 58. Use cases - Gaming
  • 59. Use cases - Gaming ‣ Sensor data can turn any device into a game controller
  • 60. Use cases - Gaming ‣ Sensor data can turn any device into a game controller ‣ High scores and other game data can be synchronized and persisted on the mobile device
  • 61. Use cases - Gaming ‣ Sensor data can turn any device into a game controller ‣ High scores and other game data can be synchronized and persisted on the mobile device ‣ Practically everyone carries a phone so can immediately join in
  • 62. Use cases - E-Learning
  • 63. Use cases - E-Learning ‣ Students are increasingly using devices for their studies
  • 64. Use cases - E-Learning ‣ Students are increasingly using devices for their studies ‣ Connected class rooms with shared whiteboards and collaborative tasks
  • 65. Use cases - E-Learning ‣ Students are increasingly using devices for their studies ‣ Connected class rooms with shared whiteboards and collaborative tasks ‣ Teachers can get realtime data and statistics on how their students perform on particular exercises
  • 66. Use cases - Sensor input
  • 67. Use cases - Sensor input ‣ Mobile devices can provide additional input to your computer
  • 68. Use cases - Sensor input ‣ Mobile devices can provide additional input to your computer ‣ Software can take advantage of multi-touch, accelerometer, geolocation data and camera access
  • 69. Use cases - Sensor input ‣ Mobile devices can provide additional input to your computer ‣ Software can take advantage of multi-touch, accelerometer, geolocation data and camera access ‣ Mobile device becomes a second screen and helps with your productivity
  • 72. Introducing Cocoon P2P ‣ Simple open source library focussed on local IP multicast with Flash Player 10.1 or later and AIR across devices
  • 73. Introducing Cocoon P2P ‣ Simple open source library focussed on local IP multicast with Flash Player 10.1 or later and AIR across devices ‣ Very easy to use, avoid boilerplate code
  • 74. Introducing Cocoon P2P ‣ Simple open source library focussed on local IP multicast with Flash Player 10.1 or later and AIR across devices ‣ Very easy to use, avoid boilerplate code ‣ Early support for file transfer, video streaming and accelerometer cocoon-p2p.googlecode.com
  • 75. Example - device discovery
  • 76. Example - device discovery <p2p:LocalNetworkDiscovery id="channel" clientName="FFK11 - beyond tellerrand" / > <s:List width="80%" height="200" horizontalCenter="0" verticalCenter="0" dataProvider="{channel.clients}" labelField="clientName" />
  • 78. Example - messaging <p2p:LocalNetworkDiscovery id="channel" clientAdded="onClientAdded(event)" clientRemoved="onClientRemoved(event)" dataReceived="onDataReceived(event)" loopback="true" /> channel.sendMessageToAll("Hello everyone!"); channel.sendMessageToClient("Hello you!", peerID);
  • 79. Example - photo sharing
  • 80. Example - photo sharing <p2p:LocalNetworkDiscovery id="channel" dataReceived="onDataReceived(event)" fileComplete="onFileComplete(event)" /> var myFile:File = File.desktopDirectory.resolvePath("image.jpg"); channel.sendFileToAll(myFile); channel.sendFileToClient(myFile, peerID);
  • 82. Example - multiplayer game • <p2p:LocalNetworkDiscovery id="channel" accelerometerInterval="1000" /> <p2p:LocalNetworkDiscovery id="channel" accelerometerUpdate="onAccelerometer(event)" /> private function onAccelerometer(evt:AccelerometerEvent):void { trace("x acceleration: "+evt.accelerationX); trace("y acceleration: "+evt.accelerationY); trace("z acceleration: "+evt.accelerationZ); }
  • 83. Example - video streaming
  • 84. Example - video streaming • <p2p:LocalNetworkDiscovery id="channel" videoStream="{cam}" /> var cam:Camera = Camera.getCamera(); var video:Video = new Video(320,240); video.attachCamera({channel.videoStream});
  • 87. Security dialog ‣ Everything covered here does not require Adobe AIR
  • 88. Security dialog ‣ Everything covered here does not require Adobe AIR ‣ Using P2P in Flash Player will prompt a security dialog
  • 89. Security dialog ‣ Everything covered here does not require Adobe AIR ‣ Using P2P in Flash Player will prompt a security dialog ‣ User can control whether or not to allow peer assisted networking
  • 90. Security dialog ‣ Everything covered here does not require Adobe AIR ‣ Using P2P in Flash Player will prompt a security dialog ‣ User can control whether or not to allow peer assisted networking ‣ For AIR applications this is allowed by default without user interaction
  • 92. Summary ‣ P2P is available from Flash Player 10.1 onwards and in Adobe AIR across devices (including iOS, BlackBerry PlayBook, Google TV,...)
  • 93. Summary ‣ P2P is available from Flash Player 10.1 onwards and in Adobe AIR across devices (including iOS, BlackBerry PlayBook, Google TV,...) ‣ You can use this feature for connecting local devices without the need for a Flash Media Server
  • 94. Summary ‣ P2P is available from Flash Player 10.1 onwards and in Adobe AIR across devices (including iOS, BlackBerry PlayBook, Google TV,...) ‣ You can use this feature for connecting local devices without the need for a Flash Media Server ‣ Devices need to be on the same wifi network and IP multicast must not be blocked on the router
  • 96. Resources ‣ Tom Krcha - flashrealtime.com
  • 97. Resources ‣ Tom Krcha - flashrealtime.com ‣ HydraP2P - github.com/devboy/HydraP2P
  • 98. Resources ‣ Tom Krcha - flashrealtime.com ‣ HydraP2P - github.com/devboy/HydraP2P ‣ Cirrus (formerly Stratus) - labs.adobe.com/technologies/cirrus
  • 100. Questions? Peter Elst e-mail info@peterelst.com twitter @peterelst blog www.peterelst.com company www.project-cocoon.com
  • 101. Thank you! Peter Elst e-mail info@peterelst.com twitter @peterelst blog www.peterelst.com company www.project-cocoon.com

Notas do Editor

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n
  53. \n
  54. \n
  55. \n
  56. \n
  57. \n
  58. \n
  59. \n
  60. \n
  61. \n
  62. \n
  63. \n
  64. \n
  65. \n
  66. \n
  67. \n
  68. \n
  69. \n
  70. \n
  71. \n
  72. \n
  73. \n
  74. \n
  75. \n
  76. \n
  77. \n
  78. \n
  79. \n
  80. \n
  81. \n
  82. \n
  83. \n