Check out the netstream doco on adobe site.
you got 2 options to send data by p2p
1) netstream send (for a relatively small % of memebers of the group
sending info out). does not sound like your route as I imagine you want
all the players to broadcast their info
2) netgroup.post() (for many to many messaging of "small" objects) ,
this seems more appropriate for your use case.
A good starting point would be a sample p2p chat project that works, and
add the login to post when the character moves.
Thanks for fast answer.
Yes I have build a simple chat p2p using only NetGroup, and sending messages by method post(). The one "bad thing" I nothiced is delay. I got about 500ms. That's too much for real time games.
I have watch some tutorials on Tom Krcha's blog and they said I should build full mesh of direct connections of all users to make P2P game.
Let's say I want to have 6 players sending and receiving info in game. What's the best way to transfer data between them? NetGroup.post() or NetStream.send() or maybe another?
PS: Please give me an example how to receive data in NetStream if data was transfered by send() method.
Doc says :How do I start handler on receiver app?
NetGroup.post() is not appropriate for a real-time game, as you've discovered. there could be a large delay, and messages could arrive out-of-order. NetStream.send() on 1:1 P2P NetStreams is the most appropriate for your use case. you can use a timer to send updates at intervals.