Thx for the info Louis.

this.core.quit results in deluser event to be fired. I don't use channels,
but I guess there must be a way to deal with the deluser event to force the
user to leave. Whether it is directly implemented in APE server-side or not
(and you need to implement something).

Anyway, just my thoughts on this. As I said, I don't use channels.

Another thought to APE guys, I find a bit weird that deleting the user does
not lead to him leaving all his channels. I believe that this should be
automated as it is right into the core of APE features. Maybe I am missing
something.

Nicolas.



2011/9/15 Louis Charette <[email protected]>

> this.core.quit(); doesn't fire a "userLeft" event. You still have to
> wait for the timeout for the left event to be fired. If I try this
> without actully closing the window, I can't send or received anything,
> but the other clients are not informed right away that I left.
>
> In my chat application, when I call quit, the other clients will still
> see the leaving user as connected until the timeout is reached. I
> tried to send a "left" command, but it won't work in all browsers
> (Safari) because of what I explained in a previous post (As any other
> direct Ape command)
>
>
> Depending on what you want to achieve, there are multiple way to do
> it. What I did is that in "onbeforeunload", with a Synchronous AJAX
> request, I call a php file who then send a command (using something
> similar to inlinepush) to the server, along with the user pubid. With
> this pubid, I can retrieve the user's info on the server and call a
> left command for the channel:
>
>    Ape.getUserByPubid(params.data.pubid).left('testsalon')
>
> Again, depending of what you are trying to do, once PHP sent the
> command, you can do whatever you want with the user and the other
> clients...
>
> As I said, it's not pretty. But it seems to work 90% of the time. One
> exemple where it doesn't work is if I close the browser with cmd+Q (on
> OSX)... For me it's an "ok" solution, but a more straightforward way
> to change the default timeout would be nice. Before using Ape, I was
> using Java Socket + Flash. I was kind of used to the socket closing
> instantly when the clients side was closed...
>
> On Sep 15, 5:13 pm, Nicolas <[email protected]> wrote:
> > By the way, I may be missing something, but in your case, why don't
> > you just use this.core.quit() on unbeforeunload?
> >
> > On 2 sep, 21:25, Louis Charette <[email protected]> wrote:
> >
> >
> >
> >
> >
> >
> >
> > > Yeah well I already tried this:
> >
> > >         $(window).bind('beforeunload', function() {
> >
> > > but I found the other one was working better, with Chrome at least.
> > > I just tried the raw js you quoted and it's not working either.
> >
> > >   - Louis
> >
> > > Le 2011-09-01 à 23:44, Pablo Tejada a écrit :
> >
> > > > I knew about unload and safari, is why suggested the onbeforeunload
> event. Have not tried my self but I read it works. Try raw JS like
> >
> > > > window.onbeforeunload = function(){
> > > >      //send left command
> > > >  }
> >
> > > > Sent from my iPad
> >
> > > > On Sep 1, 2011, at 10:41 PM, Louis Charette <
> [email protected]> wrote:
> >
> > > >> I changed the raw for a custom server function:
> >
> > > >> Ape.registerCmd('leavePage', true, function(params, infos) {
> > > >>      Ape.log("Leaving Page");
> > > >> });
> >
> > > >> Client side (I used Jquery) :
> >
> > > >> $(window).unload(function() {
> > > >>        console.log("Just left page");
> > > >>        ape.request.send('leavePage', {});
> > > >> });
> >
> > > >> If I reload the page with Chrome, "Leaving Page" is addend to the
> APE logs, but with Safari the log entry is not there.
> >
> > > >>   - Louis
> >
> > > >> Le 2011-09-01 à 21:37, Wes Garland a écrit :
> >
> > > >>> Does the RAW actually get sent over the wire?  Check with a packet
> sniffer if you're not sure.
> >
> > > >>> Wes
> >
> > > >>> On 1 September 2011 20:26, Louis Charette <
> [email protected]> wrote:
> > > >>> False. They both fire, but it looks like it's the RAW I'm trying to
> > > >>> send that is not working…
> >
> > > >>> On 1 sep, 20:04, Louis Charette <[email protected]> wrote:
> > > >>> > I tried the "onbeforeunload" event. Looks like it's not working
> for
> > > >>> > Chrome & Firefox. They both need "onunload", but this one doesn't
> work
> > > >>> > on Safari (Didn't tried "onbeforeunload" on safari)
> >
> > > >>> > It both doesn't fire when you simply close the page though… But I
> must
> > > >>> > agree it's the simplest solution and better than nothing :)
> >
> > > >>> >   - Louis
> >
> > > >>> > On 1 sep, 15:10, Pablo Tejada <[email protected]> wrote:
> >
> > > >>> > > This is simple to do in JavaScript, you could use the window
> onbeforeunload
> > > >>> > > event to trigger the left command before the user either quits
> or navigates
> > > >>> > > away from the webapp
> >
> > > >>> --
> > > >>> 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/
> >
> > > >>> --
> > > >>> Wesley W. Garland
> > > >>> Director, Product Development
> > > >>> PageMail, Inc.
> > > >>> +1 613 542 2787 x 102
> >
> > > >>> --
> > > >>> 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/
> >
> > > > --
> > > > 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/
>

-- 
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