4 Replies Latest reply on Apr 20, 2009 9:57 AM by M Kaufman

    Connect multiple peers

    springrider Level 1
      Is it possible to connect multiple peers at the same time? Stratus aims to help building video conference, I guess it will be necessary that one user connect connect others at the same time. Just like Skype's.
      I reviewed the sample code but not quite sure about this.
        • 1. Re: Connect multiple peers
          Michael Thornburgh Adobe Employee
          more than one peer can subscribe to a publisher at once. the publisher will send a separate copy of the stream to each subscriber. for safety, there is a limit to the number of subscribing peers allowed, controlled by NetConnection.maxPeerConnections. the default value is 8, but your code can change that as appropriate. see also NetStream.client.onPeerConnect() in the NetStream ActionScript reference.


          • 2. Re: Connect multiple peers
            springrider Level 1
            Sounds good, thanks!
            • 3. Re: Connect multiple peers

              I've been playing around with stratus, and in the situation that you want several people connected and to be able to have any given peer send a message to all other peers, the only way to do this it seems is to create sort of a web of streams.

              So in the case of 4 people all talking to each other, you would need a send stream and a receive stream for every peer. So with 4 people, each person has 6 active streams, 8 people, 14 active streams.  So unless I'm completely mistaken about needing to do this, it seems that P2P is great for a small number of people connected, but very quickly becomes much slower than FMS when dealing with (guess) 4 or more.


              I'm interested in learning the most efficient ways of connecting several people together with P2P.  I'm guessing that the way network games do this (pure speculation) is that one person acts as a host and p2p traffic all gets routed through that host?  Or is it more complicated than that?


              It's a whole new world in the flash player

              • 4. Re: Connect multiple peers
                M Kaufman

                Point-to-point direct connections as provided in Flash Player 10.0 / AIR 1.5 are best for small numbers of subscribers, yes. With larger numbers, routing the traffic via a central point like FMS is recommended.