Changeset 13755
- Timestamp:
- 05/16/08 22:20:25 (14 months ago)
- Files:
-
- 1 modified
-
dojox/trunk/cometd/_base.js (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dojox/trunk/cometd/_base.js
r13753 r13755 101 101 this.url = root||dojo.config["cometdRoot"]; 102 102 if(!this.url){ 103 console.debug("no cometd root specified in djConfig and no root passed");103 throw "no cometd root"; 104 104 return null; 105 105 } … … 137 137 }), 138 138 error: dojo.hitch(this,function(e){ 139 console.debug("handshake error!:",e);140 139 this._backoff(); 141 140 this._finishInit([{}]); … … 143 142 timeoutSeconds: this.expectedNetworkDelay/1000, 144 143 timeout: dojo.hitch(this, function(){ 145 console.debug("handshake timeout!");146 144 this._backoff(); 147 145 this._finishInit([{}]); … … 389 387 } 390 388 this._initialized=false; 389 this._handshook=false; 391 390 dojo.publish("/cometd/meta", [{cometd:this,action:"disconnect",successful:true,state:this.state()}]); 392 391 } … … 429 428 var i=this._backoffInterval+(this._advice?(this._advice.interval?this._advice.interval:0):0); 430 429 if (i>0){ 431 console.debug("Retry in interval+backoff="+this._advice.interval+"+"+this._backoffInterval+"="+i+"ms"); 430 if (console.log) 431 console.log("Retry in interval+backoff="+this._advice.interval+"+"+this._backoffInterval+"="+i+"ms"); 432 432 } 433 433 return i; … … 450 450 // check version 451 451 if(data.version < this.minimumVersion){ 452 console.debug("cometd protocol version mismatch. We wanted", this.minimumVersion, "but got", data.version); 452 if (console.log) 453 console.log("cometd protocol version mismatch. We wanted", this.minimumVersion, "but got", data.version); 453 454 successful=false; 454 455 this._advice.reconnect="none"; … … 477 478 }else{ 478 479 // If there is a problem 479 console.debug("cometd init failed"); 480 if (console.log) 481 console.log("cometd init failed"); 480 482 // follow advice 481 if(this._advice && this._advice["reconnect"]=="none"){ 482 console.debug("cometd reconnect: none"); 483 }else{ 483 if(!this._advice || this._advice["reconnect"]!="none"){ 484 484 setTimeout(dojo.hitch(this, "init", this.url, this._props),this._interval()); 485 485 } … … 518 518 if(!message["channel"]){ 519 519 if(message["success"] !== true){ 520 console.debug("cometd error: no channel for message!", message);521 520 return; 522 521 } … … 606 605 dojo.publish(tname,messages); 607 606 }catch(e){ 608 console.debug(e); 607 if (console.log) 608 console.log(e); 609 609 } 610 610 } … … 612 612 613 613 this._sendMessage = function(/* object */ message){ 614 // console.debug(this.currentTransport, this._connected, this.batch);615 // if(this.currentTransport && this._connected && !this.batch){616 614 if(this.currentTransport && !this.batch){ 617 615 return this.currentTransport.sendMessages([message]); … … 736 734 737 735 if(this._cometd._advice && this._cometd._advice["reconnect"]=="none"){ 738 console.debug("cometd reconnect: none");739 736 return; 740 737 } … … 745 742 if(!this._cometd._initialized){ return; } 746 743 if(this._cometd._polling) { 747 console.debug("wait for poll to complete or fail");748 744 return; 749 745 } … … 786 782 error: dojo.hitch(this, function(err){ 787 783 this._cometd._polling=false; 788 console.debug("tunnel opening failed:", err);789 784 dojo.publish("/cometd/meta", [{cometd:this._cometd,action:"connect",successful:false,state:this._cometd.state()}]); 790 785 this._cometd._backoff(); … … 811 806 handleAs: this._cometd.handleAs, 812 807 load: dojo.hitch(this._cometd, "deliver"), 813 error: dojo.hitch(this, function(err){814 console.debug('dropped messages: ',messages);815 }),816 808 content: { 817 809 message: dojo.toJson(messages) … … 899 891 error: dojo.hitch(this, function(err){ 900 892 this._cometd._polling=false; 901 console.debug("tunnel opening failed:", err);902 893 dojo.publish("/cometd/meta", [{cometd:this._cometd,action:"connect",successful:false,state:this._cometd.state()}]); 903 894 this._cometd._backoff();