I've searched Google a lot. In all the examples having Comet
with PHP
and jQuery
. They are doing:
setTimeout(function(){ check_new_data_function() }, 5000);
function check_new_data_function(){
$.ajax{
blah
}
}
And yes, it's pretty simple to use Comet with checks in every 5 seconds. But this could not be called "COMET" at all, isn't the purpose of Comet to not loop our requests? and instead get the data which is Pushed from server?
See this example.
Or another clip.
They are all having a function which gets the data from another file with $.ajax
requests by looping. But are they really Long Polling/Comet
?
As far as I knew when we didn't want to put the server under many $.ajax
request which are looped, we would use Comet, in Comet the data is gonna Pushed from server to the client browser, was I wrong?
Could someone make this idea clear for me?