Mercurial > hg > FederatedLinda
view src/fdl/old/test2/TestRing.java @ 114:3b877c9a44f5
gather old packages
author | kazz |
---|---|
date | Mon, 11 Oct 2010 14:29:37 +0900 |
parents | src/fdl/test2/TestRing.java@0ea086f0e96f |
children |
line wrap: on
line source
package fdl.old.test2; import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.nio.ByteBuffer; import fdl.FederatedLinda; import fdl.PSXLinda; import fdl.PSXReply; public class TestRing { static int id; public static void main(String args[]){ try{ FederatedLinda fdl; PSXLinda psx; String host = "127.0.0.1"; PSXReply r; FileReader in = new FileReader("nodelist"); BufferedReader br = new BufferedReader(in); String line; while ((line = br.readLine()) != null) { int i1 = Integer.parseInt(line); fdl = FederatedLinda.init(); psx = fdl.open(host,i1); r = psx.in(65535); fdl.sync(1); ByteBuffer data = ByteBuffer.allocate(10); data.putInt(10); data.flip(); psx.out(1,data); while(!r.ready()){ psx.sync(0); } } br.close(); in.close(); }catch (IOException e) { System.err.println("Communication failure."); } } }