//Instantiate APE Client
var client = new APE.Client();
var id='556' ;
var cadena = "Mensaje enviado al canal: "+id;
//Load APE Core
client.load();
//Intercept 'load' event. This event is fired when the
Core is loaded and ready to connect to APE Server
client.addEvent('load', function() {
//Call the core start function to connect to APE
Server
client.core.start();
});
//4) Listen for the ready event to know when your client
is connected
var mensaje= function() {
//console.log('Cliente conectado');
//1) join 'id'
client.core.join(id);
//2) Intercept multiPipeCreate event
client.addEvent('multiPipeCreate', function(pipe,
options) {
//3) Send the message on the pipe
if (pipe.properties.name == id) {
pipe.request.send('send',{'msg': cadena});
}
console.log('Se envio el mensaje en el canal
'+id);
});
};
function test()
{
mensaje();
}
</script>
<div id=putmessagehere></div>
<input type=submit onclick=test()>
</body>
</html>
The problem is the follow
i need call this event multiple times, is it possible?, because with
this example i just can send one time
--
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/