summaryrefslogtreecommitdiffstats
path: root/performance-tests/RMI/CalculatorClient/Program.cs
diff options
context:
space:
mode:
Diffstat (limited to 'performance-tests/RMI/CalculatorClient/Program.cs')
-rw-r--r--performance-tests/RMI/CalculatorClient/Program.cs34
1 files changed, 34 insertions, 0 deletions
diff --git a/performance-tests/RMI/CalculatorClient/Program.cs b/performance-tests/RMI/CalculatorClient/Program.cs
new file mode 100644
index 0000000..2532ea3
--- /dev/null
+++ b/performance-tests/RMI/CalculatorClient/Program.cs
@@ -0,0 +1,34 @@
+using System;
+using CalculatorCommonLib;
+using Hik.Communication.Scs.Communication.EndPoints.Tcp;
+using Hik.Communication.ScsServices.Client;
+using System.Diagnostics;
+
+namespace CalculatorClient
+{
+ class Program
+ {
+ static void Main()
+ {
+ Console.WriteLine("Press enter to connect to server and call " + Consts.MethodCallCount + " methods...");
+ Console.ReadLine();
+
+ using (var client = ScsServiceClientBuilder.CreateClient<ICalculatorService>(new ScsTcpEndPoint("127.0.0.1", 10083)))
+ {
+ client.Connect();
+
+ var stopwatch = Stopwatch.StartNew();
+ for (var i = 0; i < Consts.MethodCallCount; i++)
+ {
+ var division = client.ServiceProxy.Add(2, 3);
+ }
+
+ stopwatch.Stop();
+ Console.WriteLine(Consts.MethodCallCount + " remote method call made in " + stopwatch.Elapsed.TotalMilliseconds.ToString("0.000") + " ms.");
+ }
+
+ Console.WriteLine("Press enter to stop client application");
+ Console.ReadLine();
+ }
+ }
+}