tags:

views:

73

answers:

1

Using BlazeDS, I have developed a simple chat room but how do I go about showing who is online and what happen if the user close the web browser without disconnect, will the user name in the online list be remove immediately?

I use mx.messaging.channels.StreamingAMFChannel and set

<subscription-timeout-minutes>3</subscription-timeout-minutes>
A: 

There is no way for the server to detect that an user closed the browser, so you need to catch the onbeforeunload event if you want to be able to remove the user as soon as possible (and not relying on a timeout mechanism). In this event send a request to the server and then you can remove the user from the online user list.

There are a lot of example how to catch the event..one is here.

Cornel Creanga
but how do I coding to show the all of the online user list?
proyb
Keep a list in memory with all the subscribers.
Cornel Creanga