How to detect disconnect event on a channel with Faye
Asked Answered
T

1

6

I am trying to make a chat on my website looking like google talk. I want to manage the disconnect event. A user can disconnect on several way :

  • By clicking the disconnect button (easy to push the event to his friends)
  • By close his windows (I can send the event to windows close javascript event but if the user has many windows open on my website, i don't want to disconnect him.)

So, how can i detect when my connection on a channel is closed? Each user has his own channel build with his id.

Thank you for help.

Trencherman answered 28/10, 2011 at 11:49 Comment(0)
D
5

You can check out the meta events, /meta/unsubscribe and /meta/disconnect.

More info here: Faye Monitoring

Deathlike answered 24/11, 2011 at 10:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.