svn commit: samba r8074 - in branches/SAMBA_4_0/testprogs/ejs: .

tridge at samba.org tridge at samba.org
Sat Jul 2 11:13:13 GMT 2005


Author: tridge
Date: 2005-07-02 11:13:12 +0000 (Sat, 02 Jul 2005)
New Revision: 8074

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=8074

Log:
demonstrate calling echo_AddOne() from ejs

Modified:
   branches/SAMBA_4_0/testprogs/ejs/echo.js


Changeset:
Modified: branches/SAMBA_4_0/testprogs/ejs/echo.js
===================================================================
--- branches/SAMBA_4_0/testprogs/ejs/echo.js	2005-07-02 11:12:33 UTC (rev 8073)
+++ branches/SAMBA_4_0/testprogs/ejs/echo.js	2005-07-02 11:13:12 UTC (rev 8074)
@@ -9,26 +9,30 @@
 	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");
+var binding = ARGV[0];
 
-test_AddOne();
-
-
-
+test_AddOne(binding);



More information about the samba-cvs mailing list