345
|
1 package alice.topology.node;
|
|
2
|
|
3 import alice.codesegment.CodeSegment;
|
|
4 import alice.datasegment.CommandType;
|
|
5 import alice.datasegment.DataSegment;
|
|
6 import alice.datasegment.Receiver;
|
|
7
|
|
8 public class IncomingReverseKey extends CodeSegment {
|
|
9
|
419
|
10 public Receiver reverseKey = ids.create(CommandType.TAKE);
|
|
11 public Receiver reverseCount = ids.create(CommandType.PEEK);
|
|
12
|
|
13 @Override
|
|
14 public void run() {
|
|
15 String reverseKey = this.reverseKey.asString();
|
|
16 String from = this.reverseKey.from;
|
480
|
17 DataSegment.getAccept(from).setReverseKey(reverseKey);
|
419
|
18
|
|
19 int reverseCount = this.reverseCount.asInteger();
|
|
20 reverseCount++;
|
|
21 ods.update("local", "reverseCount", reverseCount);
|
516
|
22 ods.put("connection"+reverseKey, reverseKey);
|
419
|
23 IncomingReverseKey cs = new IncomingReverseKey();
|
|
24 cs.reverseKey.setKey("local", "reverseKey");
|
|
25 cs.reverseCount.setKey("local", "reverseCount");
|
|
26 }
|
345
|
27
|
|
28 }
|