annotate src/alice/topology/manager/reconnection/ReceiveError.java @ 270:23e53aaa8720

reconnect manager worked.
author sugi
date Wed, 21 Aug 2013 15:33:49 +0900
parents 9982e1c4f099
children 3667ab045530
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
267
fac206b7849c create Send/Receive Error class
sugi
parents:
diff changeset
1 package alice.topology.manager.reconnection;
fac206b7849c create Send/Receive Error class
sugi
parents:
diff changeset
2
fac206b7849c create Send/Receive Error class
sugi
parents:
diff changeset
3 import java.io.IOException;
fac206b7849c create Send/Receive Error class
sugi
parents:
diff changeset
4 import java.net.Socket;
fac206b7849c create Send/Receive Error class
sugi
parents:
diff changeset
5 import alice.codesegment.CodeSegment;
fac206b7849c create Send/Receive Error class
sugi
parents:
diff changeset
6 import alice.datasegment.CommandType;
fac206b7849c create Send/Receive Error class
sugi
parents:
diff changeset
7 import alice.datasegment.Receiver;
fac206b7849c create Send/Receive Error class
sugi
parents:
diff changeset
8 import alice.topology.HostMessage;
fac206b7849c create Send/Receive Error class
sugi
parents:
diff changeset
9
268
709936c00c89 creating reconnect manager
sugi
parents: 267
diff changeset
10 public class ReceiveError extends CodeSegment {
267
fac206b7849c create Send/Receive Error class
sugi
parents:
diff changeset
11 public Receiver reportInfo = ids.create(CommandType.TAKE);
fac206b7849c create Send/Receive Error class
sugi
parents:
diff changeset
12
268
709936c00c89 creating reconnect manager
sugi
parents: 267
diff changeset
13 public ReceiveError(){
267
fac206b7849c create Send/Receive Error class
sugi
parents:
diff changeset
14 reportInfo.setKey("_ERROR");
fac206b7849c create Send/Receive Error class
sugi
parents:
diff changeset
15 }
fac206b7849c create Send/Receive Error class
sugi
parents:
diff changeset
16
fac206b7849c create Send/Receive Error class
sugi
parents:
diff changeset
17 @Override
fac206b7849c create Send/Receive Error class
sugi
parents:
diff changeset
18 public void run() {
269
9982e1c4f099 debugging reconnectManager
sugi
parents: 268
diff changeset
19 System.out.println("run Receive Error");
267
fac206b7849c create Send/Receive Error class
sugi
parents:
diff changeset
20 HostMessage message = reportInfo.asClass(HostMessage.class);
fac206b7849c create Send/Receive Error class
sugi
parents:
diff changeset
21 try {
fac206b7849c create Send/Receive Error class
sugi
parents:
diff changeset
22 Socket socket = new Socket(message.name, message.port);
fac206b7849c create Send/Receive Error class
sugi
parents:
diff changeset
23 socket.close();
fac206b7849c create Send/Receive Error class
sugi
parents:
diff changeset
24 } catch (IOException e) {
270
23e53aaa8720 reconnect manager worked.
sugi
parents: 269
diff changeset
25 System.out.println("Erorr");
23e53aaa8720 reconnect manager worked.
sugi
parents: 269
diff changeset
26 System.out.println(message.name);
23e53aaa8720 reconnect manager worked.
sugi
parents: 269
diff changeset
27 System.out.println(message.port);
268
709936c00c89 creating reconnect manager
sugi
parents: 267
diff changeset
28 new CheckABSName(message);
709936c00c89 creating reconnect manager
sugi
parents: 267
diff changeset
29 return;
267
fac206b7849c create Send/Receive Error class
sugi
parents:
diff changeset
30 }
268
709936c00c89 creating reconnect manager
sugi
parents: 267
diff changeset
31 new ReceiveError();
267
fac206b7849c create Send/Receive Error class
sugi
parents:
diff changeset
32 }
fac206b7849c create Send/Receive Error class
sugi
parents:
diff changeset
33
fac206b7849c create Send/Receive Error class
sugi
parents:
diff changeset
34 }