Compare commits

...

10 Commits
v1.0 ... master

Author SHA1 Message Date
hans b5a458973e 删除 rpc_plugin.dll 2025-07-30 15:47:01 +08:00
hans 0c4f816f73 上传文件至 demo 2025-07-30 15:46:33 +08:00
hans 5dbf041898 上传文件至 plugin/nextgen 2025-07-30 15:45:56 +08:00
hans c42701c094 上传文件至 funcext 2025-07-30 15:45:13 +08:00
hans b6b2260703 "更新文档, 20220727" 2022-07-27 18:07:25 +08:00
hans c0c6594aeb "更新文档" 2022-07-27 17:29:02 +08:00
hans 5ab5735c44 release 1.0 2022-07-27 17:02:05 +08:00
hans 239b42340c update pdf 2022-07-27 15:23:46 +08:00
hans 159fd17180 release v1.0 2022-07-27 14:58:36 +08:00
hans ca63b2cb8f 删除 'rpc_plugin.pdf' 2022-07-27 14:57:11 +08:00
8 changed files with 49 additions and 0 deletions

15
demo/demo-client.tsl Normal file
View File

@ -0,0 +1,15 @@
//login 远程rpc_server
[err, h] := rpc_login("127.0.0.1:1234", "test", "password-token");
if err then
return echo "login fail:", err;
for i:=0 to 99 do Begin
echo "remote call demo_function1: ", i, "\n";
rpc_exec(h, 30*1000, "demo_function1", "hello: " $ datetimetostr(now()));//远程执行模型
End;
for i:=0 to 99 do Begin
echo "remote call demo_function2: ", i, "\n";
rpc_exec(h, 30*1000, "demo_function2", "world: " $ datetimetostr(now()));//远程执行模型
End;

5
demo/demo-server.tsl Normal file
View File

@ -0,0 +1,5 @@
rpc_register_func("demo_function1", "demo_function2");//注册server端函数列表
echo "Listen: 1234\n";
rpc_server("0.0.0.0:1234", 5, "password-token");//启动rpc_server服务等待进程结束

21
demo/readme Normal file
View File

@ -0,0 +1,21 @@
rpc API
1、rpc_server 启动rpc服务
rpc_server(host, threads-pool-count, password-token [,callbackfunc], [isjoin]);
eg: rpc_server('0.0.0.0:1234', 5,, "password");
2、rpc_login clinet端登录rpc-server
[err, handle] := rpc_login(host, uid, pwssword);
err=0, 登录成功,返回登录句柄;
err非0登录失败。
3、rpc_logout 登出
rpc_logout(handle);
4、rpc_exec 远程执行server端模型
[err, result] := rpc_server(handle, timeout, function_name, argv1, argv2...);
err=0执行成功result为执行结果
err非0执行失败result为错误原因。
5、rpc_register_func server端注册服务函数列表
rpc_register_func(func1, func2, func3...);

View File

@ -0,0 +1,4 @@
Function demo_function1(msg);
Begin
echo "demo_function1:", msg, "\n";
End;

View File

@ -0,0 +1,4 @@
Function demo_function2(msg);
Begin
echo "demo_function2:", msg, "\n";
End;

Binary file not shown.

Binary file not shown.

Binary file not shown.