Mercurial > hg > Members > tatsuki > Alice
view src/alice/test/codesegment/TestRemoteAlice.java @ 20:0bb03861b5cd
set name to Thread
author | kazz <kazz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 15 Jan 2012 18:44:25 +0900 |
parents | e7867328a2fb |
children |
line wrap: on
line source
package alice.test.codesegment; import java.io.IOException; import java.net.InetSocketAddress; import java.nio.channels.SocketChannel; import alice.daemon.AliceDaemon; import alice.daemon.Config; import alice.daemon.Connection; import alice.datasegment.DataSegment; import alice.datasegment.RemoteDataSegmentManager; public class TestRemoteAlice { public static void main(String[] args) { Config conf = new Config(args); new AliceDaemon(conf).listen(); boolean connect = true; do { try { SocketChannel sc = SocketChannel.open(new InetSocketAddress(conf.hostname, conf.connectPort)); Connection connection = new Connection(sc.socket()); RemoteDataSegmentManager manager = new RemoteDataSegmentManager(connection); DataSegment.regist(conf.key, manager); connect = false; } catch (IOException e) { try { Thread.sleep(500); } catch (InterruptedException e1) { e1.printStackTrace(); } } } while (connect); new RemoteStartCodeSegment().execute(); } }