-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTestMain.cs
More file actions
46 lines (42 loc) · 1.02 KB
/
TestMain.cs
File metadata and controls
46 lines (42 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using System;
using System.Collections.Generic;
using System.Text;
using pxprpc;
using pxprpc.backend;
namespace pxprpc.tests
{
class TestFuncMap{
public string get1234()
{
return "1234";
}
public void printString(string s)
{
Console.WriteLine(s);
}
public void wait1Sec(Action<Object> done)
{
var tim=new System.Timers.Timer(1000);
tim.AutoReset = false;
tim.Elapsed += (object sender, System.Timers.ElapsedEventArgs e) =>
{
done(null);
};
tim.Start();
}
public string raiseError1()
{
throw new Exception("dummy io error");
}
}
public class TestMain
{
public static void Main(string[] args)
{
TcpBackend tcp = new TcpBackend();
tcp.funcMap["test1"] = new TestFuncMap();
tcp.bindAddr = "0.0.0.0:2050";
tcp.listenAndServe();
}
}
}