Skip to main content
Known Participant
February 17, 2007
Question

helloVideo app in the O'Reilly book

  • February 17, 2007
  • 2 replies
  • 287 views
Hi guys,
I am going over the helloVideo app in the O'Reilly book.

I am having a bit of bother with user disconnecting from the app.
application.onDisconnect is not triggering till the last user leaves the room. So the idPool doesn't get updated.

I am looking over the book and i cant see anything i missed.

NetConnection.Connect.Closed
is returned after nc.close() is called.

I presume i should be seeing the trace on the application.onDisconnect()and that the users_so should be updated triggering a change for every other user connected.

Anyone?

Thanks
Paul
    This topic is closed to new replies. Start a new post to keep the conversation going.

    2 replies

    February 17, 2007
    There's been a problem with server side detection of disconnects since FCS 1.0. You'll notice that somtimes the server doesn't respond if the client closes the connection, and never fires if the connection is terminated when the connection is broken (try pulling your network cabe when connected to FMS... you see that FMS sees the client as "still there").

    My solution is to build a set of client server methods to update user status. On a 5 second interval, the client calls the server method, which in turn updates the client object with a timestamp (in a variable). Every 10 seconds, the server method loops through the clients and checks the timestamp. If it's more than 10 seconds old, it means the client hasn't updates, so the server calls client.disconnect on that client.
    Known Participant
    February 17, 2007
    Care to post some example code?