This document summarizes and compares sockets and peer-to-peer (P2P) communication methods for Flash applications. Sockets use a client-server architecture and do not require an Adobe-specific implementation, but a server is needed. P2P allows direct communication between clients without a server, using Adobe's RTMFP implementation. Examples of a basic sockets program and a P2P chat application are provided to demonstrate the concepts.
1 of 21
More Related Content
P2P vs Sockets: Communication on the Flash Platform
3. Forms Of
Communication
› Sockets
› NetConnection + NetGroup
› HTTPBased
» WebService (SOAP)
» HTTPService (REST)
› RemoteObject (AMF)
4. High Level --
Sockets
› Client-Server Architecture
› Flash Independent
› Requires a server of some kind
5. High Level -- P2P
› Peer to Peer Communication
› Adobe specific implementation (RTMFP)
› No server required*, all clients can
communicate
*P2P Setup requires a server or ip multicast to maintain the mesh.
17. Sockets vs
› Communication is (more) private › Can function purely with Flash
› Gets through most firewalls › Broadcasts are simpler and
Bandwidth Efficient
18. Private
Communication
› Sockets send packets directly to recipient
› P2P requires directing code
» Example
» http://www.flashrealtime.com/directed-routing-
explained-flash-p2p/
› Encryption for security over the network
» AS3Crypto -- https://code.google.com/p/as3crypto/