icomet
icomet copied to clipboard
Closing connection?
Can I close connection from JavaScript ?
Yes, call comet.stop()/iComet.stop().
Thanks, I am using the code below but the connection remains alive. Am I missing something here -
<script type="text/javascript">
var comet = new iComet({
channel: '52ecade096a367b59dcb8cbd581f2ae53a4f8a8763b9d',
subUrl: 'http://myurl/comet/sub',
callback: function(content){
// on server push
console.log(content);
if (content.indexOf("completed") >= 0)
{
console.log('the End');
comet.stop();
}
}
});
</script>
Hi, the connection could not be closed instantly, wait for ``channel_timeout` seconds, the connection will be closed.
But the timeout is not working, see the attached screenshot.
