Skip to main content
Participant
November 20, 2007
Question

FMS client freeze when closing bad connection

  • November 20, 2007
  • 2 replies
  • 371 views
I'm working on a network application that uses an rtmpt connection to tunnel through proxy servers.

I'm using an interval to check connectivity and reconnect if the client hasn't heard from the server in a while. The client freezes for up to several minutes when I call NetConnection.close() after detecting a bad connection. The client freeze is not accompanied by memory or CPU spikes, but the browser becomes unresponsive. I've seen the problem on Windows and OS X running IE 7 and Firefox 2. It doesn't seem to happen if I wait for the connection to timeout naturally, but that takes too long.

It seems like there's something wrong within the NetConnection object. Perhaps there's something I'm missing when I try to disconnect cleanly. Here's the interval function that checks/closes the connection...




/*
checkConnect is called on a 15 second interval.
It checks the value of _global.connected and takes appropriate action.
_global.connected gets set to 1 each time a Shared Object syncs from the server.
*/

public function checkConnect():Void {

if ( _global.connected == 1 ) {
// Connection is good.
// Send check in message to server
client_nc.call("handleClientCheckIn",null,_global.userdata.username);
} else if ( _global.connected == 0 ) {
// Connection is bad.
// Sending test heartbeat signal. This will update an SO that should sync back to the client
client_nc.call("handleTestHeartbeat",null, _global.userdata.id);
} else if ( _global.connected == -1 ) {
// Connection has been bad for a while. Forcing disconnect.
// Clear the interval that calls this function
clearInterval(checkInterval);
// Clear the status listener
client_nc.onStatus = null;
// Close the connection
client_nc.close();
// Undefined the NetConnection object
client_nc = null;
// Call reconnect function
reconnect();
}

// reduce value of _global.connected
_global.connected--;
}




There are definitely network problems on the client side. I have several clients at one firm, and they all seem to disconnect simultaneously. Clients at other firms have no problem. I'm working on getting that particular client to check and adjust their proxy server settings. But I'm not in control of that and I am -- or at least should be -- in control of the Flash client.
    This topic is closed to new replies. Start a new post to keep the conversation going.

    2 replies

    Participant
    April 9, 2008
    I have a similar problem with one of my applications (a flash module included in an html portal).
    When the connection to the FMS is slowed, the navigation from page to page freezes with Firefox (sometimes even the browser crashes).

    Did you found a solution ?
    edgulAuthor
    Participant
    April 9, 2008
    I've noticed that, in my case, problem only happens with an rtmpt connection. Since I'm working mostly with clients behind proxies, this fact isn't that helpful.