Quantcast Flash Media Server 2 and Ghost Connections | The Danosphere.

The Danosphere.

Avatar

class TheDanosphere extends Dan implements Blog

Flash Media Server 2 and Ghost Connections

Recently while working on a project using Flash Media Server 2, I discovered a rather major issue with the server itself. If a user disconnects in a less-than-graceful manner, such as losing internet connection, or unplugging their LAN cable, or something of that nature, the server seems to think they are still connected! At first I didn’t believe it but after further testing, sure enough the connection were being left open in FMS2, and this led to all types of other problems when FMS2 tried to send data to clients that actually no longer exist!

I contacted Adobe about this issue, and they confirmed this was indeed a bug (of course I had to make a sample app to prove it to them first). While there is not immediate Adobe solution to this issue, with the help of some other FMS’ers I have come up with this temporary solution. It is basically a heartbeat on the server side which calls a function on each client and waits for a response. If no response is received within XX secs, it can be assumed the client is no longer connected. This solution works well except if you have an application that does a lot of data crunching. Because if the app is crunching data, it wont respond to the heartbeat until the data is processed, and this can lead to false disconnects, something to keep in mind.

Here is the file i sent to adobe, which both illustrates the issue, and has a workaround to detect the detected client faster than FMS2 does on its own.

Ghost Connection Workaround

Share this post with friends:
  • Twitter
  • Facebook
  • LinkedIn
  • email
  • del.icio.us
  • Digg
  • Reddit
  • Google Bookmarks
  • Mixx
  • StumbleUpon
  • Tumblr

Related Posts

  • Mike D

    Link is dead..

  • http://www.thedanosphere.com Dan

    Thanks mike! Should be fixed now ;)

  • http://none Damian

    Will this work for applications that handles a whole lot of data streams? Like 15 people simultaneously connected with chat, whiteboards, video and audio?

  • http://www.thedanosphere.com Dan

    We have tested it with about 30 people and a crap load of data throughput, it does seem to work very well.

    It isn’t foolproof, because of the way clients respond to fms calls the time between call and response isn’t always instantaneous. If the client is crunching a bunch of data, the response will be delayed, sometimes resulting in false disconnects.

    But it is pretty much the best solution available til Adobe does something about it. I haven’t had a chance to see if FMS3 remedied this issue or not….

    The hack can be applied from either the client or server side, we have found using it on the server side to be most effective….

blog comments powered by Disqus

What's Here?