Remote Procedure Calls with PureBasic
Posted: Sun May 11, 2008 9:59 pm
Well, having a break away from it certainly brought me back with a fresh look at it, and here is a rudimentary version:
http://www.shadowtavern.com/code/remoting.zip
When I've rested a bit, I'll write up how it works, but briefly, on the client side, add the procedure that is to be called in "client include.pb". The trick for the client side is:
This will allow fora method to be called with up to 20 paramters.
On the server side, there are two files to update.
"server procedures.pb" are the actual procedures that will be executed on the server, just treat it like a normal procedure.
"server xml params.pb" is the trick, there is procedure called "ExecuteXML". This has the select case statement for each procedure, typing the parameters and handles the response.
Enjoy!
~ Foz
http://www.shadowtavern.com/code/remoting.zip
When I've rested a bit, I'll write up how it works, but briefly, on the client side, add the procedure that is to be called in "client include.pb". The trick for the client side is:
Code: Select all
XMLRPC_MethodCall("MethodName", "pb type" + "pb value" [, "pb type" + "pb value", ...]
On the server side, there are two files to update.
"server procedures.pb" are the actual procedures that will be executed on the server, just treat it like a normal procedure.
"server xml params.pb" is the trick, there is procedure called "ExecuteXML". This has the select case statement for each procedure, typing the parameters and handles the response.
Code: Select all
Case "AddIt"
Protected result.l = AddIt(Val(mc\Parameter[0]), Val(mc\Parameter[1]))
XMLRPC_MethodResponse(ClientID, "l", Str(result))
~ Foz