[APE Project] Test if server is up and running on the client-side with APE_JSF

26 views
Skip to first unread message

eerne

unread,
May 15, 2010, 9:58:21 AM5/15/10
to APE Project
What is the best approach to test if an APE server is up and running,
by the client side?

And second question on that subject, what's the best way to stop APE
from the request loop?

After from some help on IRC I currently have this:

var client = new APE.Client();
client.load({
'channel': 'test',
'identifier': 'testdemo',
'connectOptions': {'name': 'user' + $random(0, 1234567890)},
'pollTime': 2000 // for testing purpose
});
client.addEvent('load', function(){
(function(){
//client.core.quit();
client.core.rawQuit();
console.log('quit');
}).delay(1500);
});

When using JSONP, client.core.quit(); only falls back to 25000ms, but
doesn't stop the request loop. client.core.rawQuit(); does
successfully stop the loop, is that supposed behaviour? Is there a
better way?

Thanks in advanced
eni

--
You received this message because you are subscribed to the Google
Groups "APE Project" group.
To post to this group, send email to ape-p...@googlegroups.com
To unsubscribe from this group, send email to
ape-project...@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/

Manas B

unread,
May 15, 2010, 7:21:59 PM5/15/10
to APE Project
You can load the Self Test ape-jsf/Tools/Check/index.html
It will do the test and report back to you that server is running or
where is the problem. You need to set parameters in config for that.
This does not appear to be correct behavior. However, in api on client
side there is no such function.

You can register a command at server side by
registerCmd
http://www.ape-project.org/docs/server/commands/registerCmd.html
and stop the request.
> For more options, visit this group athttp://groups.google.com/group/ape-project?hl=en

eerne

unread,
Jun 9, 2010, 9:12:46 AM6/9/10
to APE Project
Hi Manas

Thanks for you reply the check is very helpful. To answer my own
question this is what I came up to kill the request loop:

client.addEvent('load', function(){
(function(){
if (client.core.pubid == '' || client.core.pubid === null){
client.core.rawQuit();
$('apeLog').set('text', 'APE Server: offline');
}
}).delay(2500); // set timeout
});

client.addEvent('ready', function(){
$('apeLog').set('text', 'APE Server: online');
});



On May 16, 1:21 am, Manas B <m4ma...@gmail.com> wrote:
> You can load the Self Test ape-jsf/Tools/Check/index.html
> It will do the test and report back to you that server is running or
> where is the problem. You need to set parameters in config for that.
> This does not appear to be correct behavior. However, in api on client
> side there is no such function.
>
> You can register a command at server side by
> registerCmdhttp://www.ape-project.org/docs/server/commands/registerCmd.html
Reply all
Reply to author
Forward
0 new messages