314
|
1 package alice.topology.manager.keeparive;
|
|
2
|
|
3 import alice.codesegment.CodeSegment;
|
|
4 import alice.datasegment.CommandType;
|
|
5 import alice.datasegment.Receiver;
|
|
6
|
|
7 public class RespondPing extends CodeSegment{
|
|
8 private Receiver respond = ids.create(CommandType.TAKE);
|
|
9
|
|
10 public RespondPing(String key) {
|
|
11 respond.setKey(key);
|
|
12 }
|
|
13
|
|
14 @Override
|
|
15 public void run() {
|
316
|
16 RespondData d = respond.asClass(RespondData.class);
|
318
|
17 System.out.print("ping from "+d.from);
|
|
18 System.out.println(" Recieved time "+d.time);
|
316
|
19 TaskInfo task = new TaskInfo(d.from, "_RESPONCE", 5 * 1000);
|
315
|
20 ods.put("_TASKINFO", task);
|
316
|
21
|
314
|
22 }
|
|
23
|
|
24 }
|