Skip to main content
Inspiring
November 22, 2006
Question

Reconnecting a broken stream

  • November 22, 2006
  • 7 replies
  • 805 views
In our application we stream live audio/video images of an event and record them for later review and playback. The power supply at our source locations is not reliable, and even with UPSs we run into difficulties where a video stream will be disrupted.

Once we have power restored, we want to reestablish the A/V stream from a camera and "reconnect" it to it's original, so there is a single recorded stream for the event from that camera even after power was lost. We also want to reestablish the video connection in the flash players that lost the stream when the outage occurred.

Can that be done?
    This topic is closed to new replies. Start a new post to keep the conversation going.

    7 replies

    NeeeolAuthor
    Inspiring
    December 18, 2006
    The documentation for NetConnection.Connect.Failed states that:

    "The connection attempt failed; for example, the server is not running."

    I interpret things fairly literally. When the stream has been successfully initiated, and then drops out, does this event fire?

    NeeeolAuthor
    Inspiring
    December 18, 2006
    Thanks. All my searches did not turn up that particular page in livedocs - it's exactly what I was looking for. I will use the techniques you describe to add the robustness we need.

    Thanks.
    NeeeolAuthor
    Inspiring
    December 14, 2006
    I tested this idea by setting up a timer and checking NetConnection.isConnected every 3 seconds. It kept reporting that the connection was good even after I stopped the Flash Server. I don't know what that means, but it wasn't what I expected.
    December 14, 2006
    quote:

    Originally posted by: Neeeol
    I tested this idea by setting up a timer and checking NetConnection.isConnected every 3 seconds. It kept reporting that the connection was good even after I stopped the Flash Server. I don't know what that means, but it wasn't what I expected.


    I've run in to the same problem as well. Netconnection.isConnected doesn't seem to be reliable at all. I like to call a remote method on an interval as you mentioned in your previous post. It's a little frustrating to have to do that, but at least it's reliable (it also creates a solution for missed application.onDisconnect evens on the server side)
    NeeeolAuthor
    Inspiring
    December 14, 2006
    But the onStatus event is just that - an event. If the server drops off line there is nothing to trigger the event in the first place. For instance, I see no reference to a "the server disappeared" event. (I wouldn't expect one.)

    Do I need to set up a timer, say every 3 seconds to simply test the connection status? Will the NetConnection.isConnected return false if tested after the server drops off line?

    (Would be a lot easier just to get some UPS's!)

    November 23, 2006
    You can check the onStatus events of a working netconnection and netstream and catch the various events. If you encounter an event of a loss of connection you can reestablish the netstream (if your connection still is up) or even reconnect again to your FMS server.

    If you retry often enough (use some setInterval to see if you are connected and if not, try again after xxx seconds) you will be able to maintain "maximum" uptime.

    You can reconnect your live upstream without any problems ; your customers will see a frozen image when you upstreaming PC is down and it will continue to work fine after the upstreaming PC is back online (and reconnected to your FMS)