mirror of
https://github.com/samba-team/samba.git
synced 2025-03-08 04:58:40 +03:00
r8074: demonstrate calling echo_AddOne() from ejs
This commit is contained in:
parent
b1ea58ddc4
commit
0c534699ef
@ -9,26 +9,30 @@ function irpcObj()
|
||||
return o;
|
||||
}
|
||||
|
||||
function test_AddOne()
|
||||
function test_AddOne(binding)
|
||||
{
|
||||
var status;
|
||||
var conn = new Object();
|
||||
var io = irpcObj();
|
||||
|
||||
status = rpc_connect(conn, "ncacn_ip_tcp:localhost", "rpcecho");
|
||||
printVars(status);
|
||||
printVars(conn);
|
||||
status = rpc_connect(conn, binding, "rpcecho");
|
||||
if (status.is_ok != true) {
|
||||
print("Failed to connect to " + binding + " - " + status.errstr + "\n");
|
||||
return;
|
||||
}
|
||||
|
||||
io.in.in_data = 3;
|
||||
status = rpc_call(conn, "echo_AddOne", io);
|
||||
printVars(status);
|
||||
printVars(io);
|
||||
for (i=0;i<10;i++) {
|
||||
io.in.in_data = i;
|
||||
status = rpc_call(conn, "echo_AddOne", io);
|
||||
print("AddOne(" + i + ")=" + io.out.out_data + "\n");
|
||||
}
|
||||
}
|
||||
|
||||
if (ARGV.length == 0) {
|
||||
print("Usage: echo.js <RPCBINDING>\n");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
print("Starting\n");
|
||||
|
||||
test_AddOne();
|
||||
|
||||
|
||||
var binding = ARGV[0];
|
||||
|
||||
test_AddOne(binding);
|
||||
|
Loading…
x
Reference in New Issue
Block a user