Client incorrect RMI - am i right ? if so, please fix or provide sollution
I invistigated fms 3.5 and discovered it uses SpiderMonkey Javascript 1.5 (correct me if i am wrong)
Now, this version of SpiderMonkey supports Object.prototype.__noSuchMethod__
If this is implemented, a function like:
function(mName, mArgs){
}
is invoked whenever a method that does not exist in the prototype is called.
for example, put this in a main.asc:
Client.prototype.__noSuchMethod__ = function(mName,mArgs) {
trace(mName + " was called");
}
application.onAppConnect = function(client) {
client.theMethod(); // <-this will trace "theMethod was called"
}
This is very useful, but things get ugly when a client side call is made, like
nc.call("theMethodFromClient")
Unlike expected, this will not go through __noScuhMethod__ but will default to triggering an error/warning that will call application.onStatus
Why does this behave so and not as expected ? (my guess is that when you implemented RMI for FMS in C/C++ code, you are testing only if the client has the nc.call invoked method name, otherwise to trigger error, but you ingnored to also test the Client prototype for __noSuchMethod__, in which case, no error should be triggered and default SpiderMonkey behavior should occur)
This is so sad as it would be very useful to split client side nc.calls into different service prototypes.
