I’ve shown you how to handle websockets in adobe air, and how to set up communication between flash sockets, websockets and adobe air using a library I wrote. I’ve extended the library with support for local P2P, using Cocoon P2P.
It’s another option to create a multiuser game with different inputs. Right now you can use flash sockets, websockets and rtmfp (P2P) connectivity in a mixed environment to communicate with eachother.
1 2 3 4 5 6 7 8 9 10 11
Adding a cocoon endpoint, is even simpler than adding socket endpoints, all you have to do is pass an instance of the CocoonP2PEndpoint class to the addEndpoint function of the server, and specify a groupname for the P2P netgroup. You can handle the messages just like any other message on the server, it doesn’t matter if the message comes from a socket, websocket or via rtmfp.
You can download an updated version of the library project and an updated version of the demo’s with a cocoon P2P client. Big thanks to Peter Elst for CocoonP2P, it makes P2P on the local network a lot easier to implement!