Mone
Hitting ESC (escape) button on a browser makes it stop downloading resources.
This also affects Lightstreamer's streaming connection, so if you hit the ESC button while you're looking a Lightstreamer application you will see that the streaming connection closes down (btw note that the web client will try to recover the situation after a while opening a new connection).
To avoid this problem on your application you should add a little piece of javascript that listen "esc" pressures and stops the bubbling of the event so that the streaming connection remains open. You can use this (or something equivalent):
[highlight=javascript]
function checkEscape(e) {
if(!e) e = event;
if(e.keyCode == 27) {
return false;
}
}
document.onkeydown = checkEscape;
document.onkeypress = checkEscape;
We don't embed this script in our libraries cause you could think that when your user hits the esc button is cause he wants to close any open connection and so also Lightstreamer's.
[Thanks to Zoran Perak for the hint]