0

RPC do things like this:

server define a function foo_max(para)
client call foo_max, send 'max+para'
server get 'max' and call foo_max(para)
server send return val
client get result and return

But this way is not flexible because I must define all functions at server end. My case is that I want to support user-defined callback function at client end, so how can I call the client's callback funciton at server end?

Thanks

xunzhang
  • 2,838
  • 6
  • 27
  • 44
  • Are you fully aware of the performance and security implications? Do you authentificate clients, and is so, how? –  Nov 02 '13 at 13:12
  • @delnan I don't get your meaning.. – xunzhang Nov 02 '13 at 13:13
  • This allows *anyone* to execute *arbitrary programs* on your server. They can do **anything**, you might as well post the server's login creditals on the internet. Unless, of course, you have a watertight authentification (so that only selected, trusted people can do this), but you don't seem to be a security expert. –  Nov 02 '13 at 13:17
  • @delnan yes, I am not, so how can I support the case in my question? Need I write all client-required functions at server end? – xunzhang Nov 02 '13 at 13:23
  • Well, you can attempt to sandbox the client's code, but this too requires a lot of expertise and is risky (especially if the client code needs to access data from the server process, so you can't just spawn a separate, sandboxed process). It's probably easiest to manually add all procedures the client needs on the server end, which shouldn't be *that* hard if you control the server (which you apparently do). –  Nov 02 '13 at 13:26
  • @delnan situation here is not a web service, the server is only worked for the requiring clients while other clients start other server procs. – xunzhang Nov 03 '13 at 06:35
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/40448/discussion-between-xunzhang-and-delnan) – xunzhang Nov 03 '13 at 06:45

0 Answers0