c# backend fix
[PxpRpc.git] / csharp / dotnet / pxprpc / tests / TestMain.cs
blob9d79b8317ebb63215d610d130a6170b9628908ee
1 using System;
2 using System.Collections.Generic;
3 using System.Text;
5 using pxprpc;
6 using pxprpc.backend;
8 namespace pxprpc.tests
10 class TestFuncMap{
11 public string get1234()
13 return "1234";
15 public void printString(string s)
17 Console.WriteLine(s);
19 public void wait1Sec(Action<Object> done)
21 var tim=new System.Timers.Timer(1000);
22 tim.AutoReset = false;
23 tim.Elapsed += (object sender, System.Timers.ElapsedEventArgs e) =>
25 done(null);
27 tim.Start();
29 public string raiseError1()
31 throw new Exception("dummy io error");
36 public class TestMain
38 public static void Main(string[] args)
40 TcpBackend tcp = new TcpBackend();
41 tcp.funcMap["test1"] = new TestFuncMap();
42 tcp.bindAddr = "0.0.0.0:2050";
43 tcp.listenAndServe();