2 Replies Latest reply on Mar 17, 2010 11:30 PM by Ethan Rom

    Latency expectations and workarounds

    Ethan Rom

      Use case: I'm in LA chatting with a friend in New York using NetStream.send().


      How long (milliseconds) can I expect the message "Hi!" will take to get there assuming "average" cable broadband?


      What can I do to speed this up?


      How can I detect if my peer or the remote peer I'm chatting with have a slow connection?


      If I detect a slow connection, would it be useful to recreate Netconnection and NetStreams?

        • 1. Re: Latency expectations and workarounds
          Michael Thornburgh Adobe Employee

          the semantics of NetStream.send() is that those calls are inserted in the stream timeline synchronized with the video and audio, and would be subject to the same subscribe-side buffering (NetStream.bufferTime).  for the lowest latency, NetStream.bufferTime should be set to 0.0.  Flash Player shouldn't take too long to get the message out on the wire, or deliver it to your application once received, if NetStream.bufferTime is 0.0.


          the best-case one-way lightspeed delay through optical fiber from LA to NY, not counting switching delays or queuing, is about 30 milliseconds.  the delays at each end's "last mile" for cable broadband (especially the sending side's) is likely to be several more milliseconds.  then take into account it's never the "best case" and you're sharing links with other traffic.  a more realistic number is 50+ milliseconds one-way.


          the best way to lower the delay is to increase the speed of light.


          it is not useful to re-create your NetConnection and NetStreams.  that won't make them go faster.


          you can get RTMFP's idea of the round-trip time from NetStream.info.SRTT.

          • 2. Re: Latency expectations and workarounds
            Ethan Rom Level 1

            Thank you.  Much appreciated.