Mercurial > hg > FederatedLinda
view src/fdl/test2/TestRing.java @ 66:82a292aa41ad
fix
author | one |
---|---|
date | Sat, 06 Jun 2009 14:23:02 +0900 |
parents | 629b6cfbd37f |
children | 0ea086f0e96f |
line wrap: on
line source
package fdl.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(); } } br.close(); in.close(); }catch (IOException e) { System.err.println("Communication failure."); } } }