dojox.off._startNetworkThread
dojo.require("dojox.off._common");
defined in dojox/off/_common.js
Usage
function () (view source)
if(!this.doNetChecking){ return; } window.setInterval(dojo.hitch(this, function(){ var d = dojo.xhrGet({ url: this._getAvailabilityURL(), handleAs: "text", timeout: this.NET_CHECK * 1000, error: dojo.hitch(this, function(err){ if(this.isOnline){ this.isOnline = false; // FIXME: xhrGet() is not // correctly calling abort // on the XHR object when // it times out; fix inside // there instead of externally // here try{ if(typeof d.ioArgs.xhr.abort == "function"){ d.ioArgs.xhr.abort(); } }catch(e){} // if things fell in the middle of syncing, // stop syncing dojox.off.sync.isSyncing = false; this.onNetwork("offline"); } } ), load: dojo.hitch(this, function(data){ if(!this.isOnline){ this.isOnline = true; this.onNetwork("online"); } } ) }); }), this.NET_CHECK * 1000);