Without the section of code that initializes the APE client and where/when in your code that you setup the timer to send the command to the APE server I can't really say what the problem could be, however, it does sound like you are sending the command to the APE server before the page is loaded and the APE client is connected properly. Below I show similar code that I use (note: I use my own session handling).

$(document).ready(function()
{
...
create and load APE client here
...
var APE_SERVER = 0;

var client = new APE.Client();

client.load({'channel': "pgcmd"}); // load the ciient and join command channel

client.addEvent('load', function() {
             client.core.start({'name': CUID});  // fire up APE client
});

client.addEvent('ready', function() {
        //
        // join additional channels...
        //
        client.core.join(["pgreload","pgupdate", "pgtimer"]);
});

//
// initialize our display info and send commands to APE after the pipe is created
//
client.addEvent('multiPipeCreate', function(pipe) {

  APE_SERVER = 1; // track APE server connects here

  // console.log('New pipe created '+pipe.name);

pipe.request.send('ReloadPage', {'user':CUID}) }; // send page reload command to APE server

timer1 = setInterval( "SendServerCMD('UPDATE')", 15000 ); // update the display every 15 seconds
});


//
// keep track of server disconnects so we don't try to send commands to a missing server
//
client.addEvent('apeDisconnect', function(pipe) {

  // console.log('Lost connection to server');

  APE_SERVER = 0;

  clearInterval(timer1);
});

client.addEvent('apeReconnect', function(pipe) {

  // console.log('reconnected to server');
  window.location = URL; // reload the whole page (I got lazy, lol)
});

});






On 07/18/2012 11:39 AM, Auryn wrote:
Hi everybody ! :)

So I've an application where i send a request (with pipe.request) every 800 ms, and i've a little problem. When I send the request, the check request are breaking and after 2 request are sending one for my request and one for check wich is instantly breaking by my next request : Exemple of the check request : [{"cmd":"CHECK","chl":13,"sessid":"....................................................................."}]:

Too many request are sending, so it work but i've sometimes the errors "BAD_CHL" or "BAD_SESSION".

It's possible to not break the check request when I send a request ? :o (Like have 2 requests in the same time, one for send my request and one for check)
Else what can I do ?

(Anyone says me that's the last version of APE solves the BAD_CHL's problem but I can't upgrade my APE for the moment cause my hoster is in holiday. :/)

Thanks very much ! ^^

P.S : Sorry for my bad english i'm french... :(
--
You received this message because you are subscribed to the Google
Groups "APE Project" group.
To post to this group, send email to ape-project@googlegroups.com
To unsubscribe from this group, send email to
ape-project+unsubscr...@googlegroups.com
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 ape-project@googlegroups.com
To unsubscribe from this group, send email to
ape-project+unsubscr...@googlegroups.com
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