Skip to main content
Participant
August 25, 2010
Question

How to Fire ondisconnect event when network disconnect suddenly

  • August 25, 2010
  • 3 replies
  • 1412 views

Hello Friends

                      can any body tell me how to clear the client entry from Adobe flash Media server 3.5. when net disconnect.

i was expecting that on netdisconnect from the client side end(which is connected to FMS) its onDisconnect event fire similarly as it fire for browser close.But when internet disconnect  ondisconnect event not fires at FMS side is there any way to overcome this or any other event  fire at that stage?

if it is possible to get any event on network disconnection at client sidetahn i can solve the issue.

Thanks and Regards

   Vineet osho

    This topic has been closed for replies.

    3 replies

    Inspiring
    August 25, 2010

    Hi

    You can use timestamp. You have to set a timer on the server side and check it after every 10 second. If it's updated after 5 second or you have to set a condition in the main.asc that will check your current time and updated timestamp. One more think you to call a fucntion of main.asc to update the  time stamp from the client side after every 5 second. If your timestamp is not updated then use application.disconnect function that will disconnect your current client and for multiple clients you have to use for loop for as many clients you have in your particular connection.

    calmchessplayer
    Inspiring
    August 26, 2010

    The old ghost code probelm huh I have a routine for this included in my free source code at www.calmchess.com you will have to determine what code needs to be removed in order to see it and the clientside code required for the ping is in call folder and file.

    August 25, 2010

    Hi Vineet,

    FMS maynot always be aware of a client getting disconnected when a network disconnect happens. Please go through this post where Seth has posted why it happens that way. And the way in which you can build a simple logic on your server-side application to ping idle client .

    Please refer http://forums.adobe.com/message/2300456#2300456

    Regards

    Mamata

    Adobe Employee
    August 25, 2010

    You  must be getting the "NetConnection.Connect.Closed" as info.code in the onStatus for the NetConnection.

    See http://livedocs.adobe.com/fms/2/docs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00000742.html

    nc = new NetConnection();
    nc.onStatus = function(info){
        if (info.code == "NetConnection.Connect.Closed")
        {
            // Netconnection has closed.
        }
    };
    Participant
    August 25, 2010

    Thanks nitin for your quick reply.but this code fires at client side.i am talking about FMS Side event.i meam onDisconnect event at fms side.

    nc = new NetConnection();
    nc.onStatus = function(info){
         if (info.code == "NetConnection.Connect.Closed"

    )
         {
             // Netconnection has closed.
         }
    };

    when network disconnect how can  i  fire a method to fms.

    Petro_O__Bochan
    Inspiring
    August 25, 2010

    Can't you use this? http://help.adobe.com/en_US/FlashMediaServer/3.5_SS_ASD/flashmediaserver_3.5_sslr.pdf - p.8