Reconnect on error

This commit is contained in:
burke.davey
2011-05-06 22:34:35 +00:00
parent ebd9297616
commit ea0873a8b2

View File

@@ -118,7 +118,6 @@ function initializeBrowserChannel(callback) {
if (req.status == 200) { if (req.status == 200) {
var channelId = req.responseText.substring(3).trim(); // expect 'OK <id>'; var channelId = req.responseText.substring(3).trim(); // expect 'OK <id>';
channel = new goog.appengine.Channel(channelId); channel = new goog.appengine.Channel(channelId);
console.log('Attempting to open ' + channelId);
socket = channel.open(); socket = channel.open();
socket.onopen = function() { socket.onopen = function() {
console.log('Browser channel initialized'); console.log('Browser channel initialized');
@@ -134,7 +133,7 @@ function initializeBrowserChannel(callback) {
console.log('Browser channel token expired - reconnecting'); console.log('Browser channel token expired - reconnecting');
} else { } else {
console.log('Browser channel error'); console.log('Browser channel error');
// Automatically reconnects setTimeout('initializeBrowserChannel()', 0);
} }
} }
socket.onmessage = function(evt) { socket.onmessage = function(evt) {