There may not be a bulletproof way to do the close but you can try...

window.onbeforeunload=sendclose;


That is what I am using in my chat application.


On May 20, 2010, at 6:25 AM, Sudeep S wrote:

> Hi,
> Thanks for the reply . but  in my case even after the mentioned
> timeout the user and channel are not getting disconnected. I also
> tested the Controller demo to verify, but it is also working .
> I have changed the TIMEOUT_SEC in src/main.h file to  120. It was
> initially 45. I'm using APE Version 1.00, but still the channel is
> persistent and the test.php used for inline push is showing success.
> Is it because of this?
> Also in the source file channel.c, I have added some debugging lines
> in wherein when a channel is removed using rmchan, that is also not
> getting printed in the log after the 25sec timeout period.
> 
> Thanks & Regards,
> Sudeep Snthankar
> 
> 
> On May 20, 1:56 pm, Anthony Catel <[email protected]> wrote:
>> Hi,
>> 
>> There is no reliable way to do such thing. (JS "close" is not safe
>> enough). BTW, the user automatically disconnect after 25sec (timeout),
>> and the channel is destroyed (if no body left).
>> 
>> Anthony
>> 
>> Sudeep S a écrit :
>> 
>> 
>> 
>>> Dear APE Team,
>> 
>>>    I am using inline push feature for my application. While testing I
>>> found that when I close my browser window which will display messages
>>> pushed from the external Php, the external Php is able to send
>>> messages to the channel.
>>>   Is there any way to identify for the APE server that the browser
>>> window where a user is connected is closed so that the external Php
>>> will be sent an error. If so I can tweak the Server side module by
>>> sending a custom command on such an event to remove the channel.
>> 
>>>    Thanks in advance
>> 
>>> Regards,
>>> Sudeep Sunthankar
>> 
>> --
>> You received this message because you are subscribed to the Google
>> Groups "APE Project" group.
>> To post to this group, send email to [email protected]
>> To unsubscribe from this group, send email to
>> [email protected]
>> For more options, visit this group 
>> athttp://groups.google.com/group/ape-project?hl=en
>> ---
>> APE Project (Ajax Push Engine)
>> Official website :http://www.ape-project.org/
>> Git Hub :http://github.com/APE-Project/
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "APE Project" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/ape-project?hl=en
> ---
> APE Project (Ajax Push Engine)
> Official website : http://www.ape-project.org/
> Git Hub : http://github.com/APE-Project/

-- 
You received this message because you are subscribed to the Google
Groups "APE Project" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/ape-project?hl=en
---
APE Project (Ajax Push Engine)
Official website : http://www.ape-project.org/
Git Hub : http://github.com/APE-Project/

Reply via email to