Re: LiveConnect and (Re: func.apply() throws Error -2147467259)
Richard Maher wrote:
Fair enough, but as they say in the movies "it's complicated"! Please see
below for randomator.html (<500 lines). This is a next to useless random
employee picker that is designed just to work my Applet's socket while a
more useful employee lookup page/tab is handling user requests.
....
Randomator uses an Applet to connect back to the codebase via a TCP/IP
socket.
Could you show the applet code? Those of us reading from clj.programmer are
probably in a much better position to discuss Java issues than Javascript issues.
This Socket, along with much other stuff, is held in static variable that is
common among all like-minded applets accross any number of tabs in a browser
instance.
There an awful lot of risks to static variables, mainly with respect to
concurrency collisions.
....
3) Because the Async flag on the SEND was set to false the Applet instance
will now wait in JAVA [sic] for the reader thread (well, actually, the Javascript
this.rendezvous() function) to tell it to proceed.
Seeing the Java code will really help us here in clj.programmer.
*4) Upon receiving the server response the Reader thread calls
myJSObject.call("dispatcher", args)
5) The "dispatcher" tries to call your callback "positionDiv" which works
many times before failing
All this back-and-forth between Java and Javascript seems complicated. Well,
you did say that, but I imagine there must be a more straightforward way to
deal with it.
...
Should I make positionDiv() static and pass it the EmpPicker instance or
Index as an argument? (Is "this" causing problems?)
Redux on warning about static variables.
PS. I'm really not in the mood for the regular self-appointed newsgroup
sheriffs or incurable wankers
Pot, meet kettle. Kettle, meet pot.
spelling, cross-posting, overall strategy or design philosophy. Please find
someone else to annoy for today!
Right back atcha.
--
Lew