root / trunk / web / dojo / dojox / cometd / ack.js @ 9
History | View | Annotate | Download (1 KB)
1 |
/*
|
---|---|
2 |
Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved.
|
3 |
Available via Academic Free License >= 2.1 OR the modified BSD license.
|
4 |
see: http://dojotoolkit.org/license for details
|
5 |
*/
|
6 |
|
7 |
|
8 |
if(!dojo._hasResource["dojox.cometd.ack"]){ |
9 |
dojo._hasResource["dojox.cometd.ack"]=true; |
10 |
dojo.provide("dojox.cometd.ack");
|
11 |
dojo.require("dojox.cometd._base");
|
12 |
dojox.cometd._ack=new function(){ |
13 |
var _1=false; |
14 |
var _2=-1; |
15 |
this._in=function(_3){ |
16 |
if(_3.channel=="/meta/handshake"){ |
17 |
_1=_3.ext&&_3.ext.ack; |
18 |
}else{
|
19 |
if(_1&&_3.channel=="/meta/connect"&&_3.ext&&_3.ext.ack&&_3.successful){ |
20 |
var _4=parseInt(_3.ext.ack);
|
21 |
_2=_4; |
22 |
} |
23 |
} |
24 |
return _3;
|
25 |
}; |
26 |
this._out=function(_5){ |
27 |
if(_5.channel=="/meta/handshake"){ |
28 |
if(!_5.ext){
|
29 |
_5.ext={}; |
30 |
} |
31 |
_5.ext.ack=dojox.cometd.ackEnabled; |
32 |
_2=-1;
|
33 |
} |
34 |
if(_1&&_5.channel=="/meta/connect"){ |
35 |
if(!_5.ext){
|
36 |
_5.ext={}; |
37 |
} |
38 |
_5.ext.ack=_2; |
39 |
} |
40 |
return _5;
|
41 |
}; |
42 |
}; |
43 |
dojox.cometd._extendInList.push(dojo.hitch(dojox.cometd._ack,"_in"));
|
44 |
dojox.cometd._extendOutList.push(dojo.hitch(dojox.cometd._ack,"_out"));
|
45 |
dojox.cometd.ackEnabled=true;
|
46 |
} |