setTimeout(dojo.hitch(this,function(){ this._connect(); }),500); 
dojox.cometd.longPollTransport = new function(){	this._connectionType="long-polling";	this._cometd=null;	this.check = function(types, version, xdomain){		return ((!xdomain)&&(dojo.indexOf(types, "long-polling") >= 0));	}	this.tunnelInit = function(){		var message = {			channel:	"/meta/connect",			clientId:	this._cometd.clientId,			connectionType: this._connectionType,			id:	""+this._cometd.messageId++		};		message=this._cometd._extendOut(message);		this.openTunnelWith({message: dojo.toJson([message])});	}	this.tunnelCollapse = function(){		// TODO handle transport specific advice				if(!this._cometd._initialized){ return; }					if(this._cometd._advice){			if(this._cometd._advice["reconnect"]=="none"){				return;			}			if(	(this._cometd._advice["interval"])&&				(this._cometd._advice.interval>0) ){				setTimeout(dojo.hitch(this,function(){ this._connect(); }),this._cometd._advice.interval);			}else{				this._connect();			}		}else{			this._connect();		}	}	this._connect = function(){		if(!this._cometd._initialized){ return; }		if(this._cometd._polling) {			console.debug("wait for poll to complete or fail");			setTimeout(dojo.hitch(this,function(){ this._connect(); }),500);			return;		}					if(	(this._cometd._advice) &&			(this._cometd._advice["reconnect"]=="handshake")		){			this._cometd._connected=false;			this._initialized = false;			this._cometd.init(this._cometd.url,this._cometd._props); 		}else if(this._cometd._connected){			var message={				channel:	"/meta/connect",				connectionType: this._connectionType,				clientId:	this._cometd.clientId,				id:	""+this._cometd.messageId++			};			message=this._cometd._extendOut(message);			this.openTunnelWith({message: dojo.toJson([message])});		}	}	this.deliver = function(message){		// Nothing to do	}	this.openTunnelWith = function(content, url){		this._cometd._polling = true;		var d = dojo.xhrPost({			url: (url||this._cometd.url),			content: content,			handleAs: this._cometd.handleAs,			load: dojo.hitch(this, function(data){				this._cometd._polling = false;				this._cometd.deliver(data);				this.tunnelCollapse();			}),			error: dojo.hitch(this, function(err){				this._cometd._polling = false;				console.debug("tunnel opening failed:", err);				dojo.publish("/cometd/meta", [{cometd:this._cometd,action:"connect",successful:false,state:this._cometd.state()}]);				this._cometd._backoff();				this.tunnelCollapse();			})		});	}	this.sendMessages = function(messages){		for(var i=0; i<messages.length; i++){			messages[i].clientId = this._cometd.clientId;			messages[i].id = ""+this._cometd.messageId++;			messages[i]=this._cometd._extendOut(messages[i]);		}		return dojo.xhrPost({			url: this._cometd.url||djConfig["cometdRoot"],			handleAs: this._cometd.handleAs,			load: dojo.hitch(this._cometd, "deliver"),			content: {				message: dojo.toJson(messages)			}		});	}	this.startup = function(handshakeData){		if(this._cometd._connected){ return; }		this.tunnelInit();	}	this.disconnect = function(){		var message={			channel:	"/meta/disconnect",			clientId:	this._cometd.clientId,			id:	""+this._cometd.messageId++		};		message=this._cometd._extendOut(message);		dojo.xhrPost({			url: this._cometd.url||djConfig["cometdRoot"],			handleAs: this._cometd.handleAs,			content: {				message: dojo.toJson([message])			}		});	}}
5168	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/5168/2ec9fb69243bed95ae4c407a2448ad15a7fb0e11/_base.js/buggy/cometd/_base.js