-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
48 lines (41 loc) · 1.59 KB
/
index.html
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
47
48
<!DOCTYPE html>
<html>
<head>
<script src="SignalGO.js"></script>
</head>
<body>
<h1>SignalGO Tester</h1>
<script>
var provider = new ClientProvider();
var setting = new ConnectionSettings();
provider.InitializeConnectionSettings(setting);
var service = provider.RegisterService('HelloWorld', ['Hello', 'CallClientService','Login']);
//priority functions always run after connect before call anything
//this help you for login method etc
setting.addPriorityFunction(function () {
return service.Hello(function (x) {
console.log("priority hello: " + x);
});
});
//localhost:9674
provider.Connect('ws://localhost:9674/SignalGoTestService', provider, function () {
//after connect
//HealthFamilyService is your service name and HelloWorld and Sum is your service methods
service.Login('ali yousefi',function (x) {
console.log('login called',x);
});
service.CallClientService("ali", "yousefi", function (x) {
console.log("priority CallClientService: " + x);
});
});
//HelloCallback is your client service servicename
var callback = provider.RegisterCallbackService("HelloCallback");
//ReceivedMessage is your method name and name , family is your method parameters
callback.ReceivedMessage = function (name,family) {
console.log("ReceivedMessage is called: name=" + name + " family="+family);
//result of your client method to server
return "welcome to client method!";
};
</script>
</body>
</html>