-
Notifications
You must be signed in to change notification settings - Fork 1
/
demoTX.ol
44 lines (39 loc) · 1.39 KB
/
demoTX.ol
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
include "console.iol" //console
include "message_digest.iol" //md5
include "math.iol" //random and pow
include "queue_utils.iol" //implementazione coda
include "security_utils.iol" //secureRandom and createSecureToken
include "time.iol" //getCurrentTimeMillis
include "maininterface.iol"
outputPort OutPort {
Protocol: http
Interfaces: DemoTxInterface
}
main
{
println@Console( "Starting DEMO" )();
println@Console( "Send TX1" )();
TX1.value=100000000;
TX1.location="socket://localhost:9002";
OutPort.location="socket://localhost:9001";
DemoTx@OutPort(TX1)(response);
if (response){println@Console( "TX1 executed" )()};
println@Console( "Send TX2" )();
TX2.value=200000000;
TX2.location="socket://localhost:9003";
OutPort.location="socket://localhost:9001";
DemoTx@OutPort(TX2)(response);
if (response){println@Console( "TX2 executed" )()};
println@Console( "Send TX3" )();
TX3.value=300000000;
TX3.location="socket://localhost:9004";
OutPort.location="socket://localhost:9001";
DemoTx@OutPort(TX3)(response);
if (response){println@Console( "TX3 executed" )()};
println@Console( "Send TXdummy (NetworkVisualizer)" )();
TXdummy.value=0;
TXdummy.location="socket://localhost:9000";
OutPort.location="socket://localhost:9000";
DemoTx@OutPort(TXdummy)(response);
if (response){println@Console( "TXdummy executed" )()}
}