Skip to main content
Inspiring
August 22, 2011
Question

Netconnection events not firing

  • August 22, 2011
  • 2 replies
  • 1568 views

Can anyone tell me why I would not be getting Netconnection.NetworkChange and Netconnection.Closed events would not be getting fired when I am working on Flash CS5?

I get the Success event, but when I am attempting to test my reconnection code I pull out my network cabled and I never get the closed event.

Interestingly, I do get the Closed and NetworkChange events when I am debugging, but not when I just run the movie.

    This topic has been closed for replies.

    2 replies

    MaxManNHAuthor
    Inspiring
    August 23, 2011

    Would I still be able to poll the server if I don't actually have control of the FMS? My streaming service is through Akamai and I am using the Open Video Player classes for this particular project.

    I have had such spotty perfomance from the FLVplayback control I wanted to work with something that I could dig into better when I have connection issues.

    I have also noticed today that when running in debugging I am getting the Closed event so my reconnect code fires, but then I never get the Failed event when the cable is still unplugged which is aggravating.

    calmchessplayer
    Inspiring
    August 23, 2011

    Well you probably have more control over fms than you think I seriously doubt they would allow you to connect a "home made" .swf without you being able to install a main.asc for that .swf client app. So check with your FMS Host and if they are like we don't allow that then get a hosting account with Influxis I know for a fact they allow it and encourge it. Furthur more make sure the FMS server you choose from the host is interactive or enterprise edtion because if its streaming edtion you can't use a serverside script at all.

    calmchessplayer
    Inspiring
    August 22, 2011

    well when  you pull the network cable you will get what is referred to as a "ghost connection"  To counter this you can write a server side/client side script that goes something like this.....the server constantly  asks each client "are you there" the client responds "yes I am" a "ping" if you will. if the client ever fails to contact the server then the server counts to 5(gives the client a chance to  recover if a network conditon temporarily stops connection).  and hard disconnects the client This is the most reliable in my opnion because it doesn't rely on the browser closing However another thing you can do is write a java script that says "just before the browser closes call the client and close the netconnection"...nc.close();

    Graeme Bull
    Community Expert
    Community Expert
    August 23, 2011

    Actually, I think he's referring to the fact that the Flash Player doesn't respond itself to the fact that the socket connection has died. I personally find that it's a bug of the Flash Player to not be able to properly detect at all times when the connection has been closed. Sometimes it takes putting focus back into the Flash Player..

    and then of course there is that problem that the server side doesn't get the disconnection notice.. frustrating at best.

    calmchessplayer
    Inspiring
    August 23, 2011

    oh yeah right my mistake listen to Graeme but keep my suggestion in mind for the future