view 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
line wrap: on
line source

package alice.topology.manager.reconnection;

import java.io.IOException;
import java.net.Socket;
import alice.codesegment.CodeSegment;
import alice.datasegment.CommandType;
import alice.datasegment.Receiver;
import alice.topology.HostMessage;

public class ReceiveError extends CodeSegment {
	public Receiver reportInfo = ids.create(CommandType.TAKE);
	
	public ReceiveError(){
		reportInfo.setKey("_ERROR");
	}
	
	@Override
	public void run() {		
		System.out.println("run Receive Error");
		HostMessage message = reportInfo.asClass(HostMessage.class);
		try {
			Socket socket = new Socket(message.name, message.port);
			socket.close();
		} catch (IOException e) {
			System.out.println("Erorr");
			System.out.println(message.name);
			System.out.println(message.port);
			new CheckABSName(message);
			return;
		}
		new ReceiveError();
	}

}