Hello ,
I have a question concerning evnthandlers . I am programming a chat system and have an event handler in my code that checks for user presence ( using xmpp) . this is done when a connection sends a "presence packet " which is one like this ,
connection.send(presence);
The presence is handled by an event handler which , on receipt of a packet of this kind , calls a function which handles this event accordingly.
Now my problem is that when the user closes the window ( identified by onbeforeunload), there should be a presence packet sent which should be recieved and handled by the event handler which somehow does not happen .
I would appreciate some help on this .