Re: LiveConnect and (Re: func.apply() throws Error -2147467259)
On Jan 30, 11:01 am, "Richard Maher" <maher...@hotspamnotmail.com>
wrote:
(...)
Removing the applet and the back-and-forth between Java-JS the
resulting java-less version seems to run fine:
http://jorgechamorro.com/cljs/095/
<script type="text/javascript">
function Tier3Client () {
(this.chan= {}).rendezvous= function () {
console.log("this.chan.rendezvous(), "+ (+new Date()));
};
this.chan.send= function (msgCandidate, msgBody, async) {
var r=
"31abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrst=
uvwxyz";
if (async) {
setTimeout(function () {
console.log("this.chan.send(async===true)");
msgCandidate.dispatcher(r, 0, 0);
}, (2e3*Math.random())|0);
} else {
console.log("this.chan.send(async===false)");
msgCandidate.dispatcher(r, 0, 0);
}
};
this.chan.appendConsoleMsg= function (p) {
console.log("appendConsoleMsg: "+ p);
};
}
(Tier3Client.prototype = {}).send= function (msgBody, callback,
async) {
var chan = this.chan;
var callbackArgs = [];
var i = 0;
var msgCandidate = {
dispatcher : function (responseMsg, msgSlotId, msgSeqNum) {
callbackArgs[0] = responseMsg;
callback.apply(this, callbackArgs);
},
rendezvous : function () {
console.log("msgCandidate.rendezvous(), "+ (+new Date()));
return chan.rendezvous();
}
};
for (i=3; i<arguments.length; i++) {
callbackArgs[i - 2] = arguments[i];
}
return chan.send(msgCandidate, msgBody, async);
};
Tier3Client.prototype.appendConsoleMsg= function (msg) {
console.log("Tier3Client.prototype.appendConsoleMsg(), "+ (+new
Date()));
this.chan.appendConsoleMsg(msg);
};
</script>
--
Jorge.