that depends on how big N is, and whether you need a full-mesh of connections or you can get by with transitive connectivity. that choice will probably depend on your latency requirements.
if N is less than 15-17, you can use a NetGroup and still probably have a full mesh, and that may be easier than constructing your mesh with NetStreams. you can still make your mesh with NetStreams. however, there may be performance problems if you have a lot of NetStreams.
see my session from MAX 2011 for tips and tricks to using NetGroup, including how to use its different modes and where the magic number of "15-17" comes from:
Michael, thanks for you answer. N is never going to be bigger than 10.
I've been using NetGroups and I'm kind of stuck with this issue, I need to know some data about the neighbors that connect to the NetGroup, at least a string representing their name. And since this seems easy, I can't find a good way to do it, I've tried/thought about this:
- Listening to NetGroup.Neighbor.Connect, when this event fires I check the database to see the data from the new connected player, it seems the wrong way to do it, but it works.
- Listening to NetGroup.Connect.Success, when this event fires I make a post(), but it doesn't seem to work, I've read some minutes ago that this works when you receive a NetGroup.Neighbor.Connect.
- Listening to NetGroup.Neighbor.Connect, when this event fires I send a post() or sendtoAllNeighbours() sending my custom data. This should work, but still doesn't seem the right way to do it.
Another thing, I need to be certain that this message is sent to all members of the group, it needs to be completely reliable.
My question is, what is the best way to send the data of the newly connected member to all of the previously members of the group?.