Mercurial > hg > FederatedLinda
view src/fdl/test/transfer/two/TestGet.java @ 66:82a292aa41ad
fix
author | one |
---|---|
date | Sat, 06 Jun 2009 14:23:02 +0900 |
parents | b342dc9b52eb |
children |
line wrap: on
line source
package fdl.test.transfer.two; import java.io.IOException; import java.nio.ByteBuffer; import fdl.FederatedLinda; import fdl.PSXLinda; import fdl.PSXReply; public class TestGet extends Thread { private static PSXLinda psxget; private static FederatedLinda fdlget; private static int port = 10001; static String host = "127.0.0.1"; private static ByteBuffer data = ByteBuffer.allocate(1024); public static void main(String[] args){ int id = 10; int i; fdlget = FederatedLinda.init(); try { System.out.println("TestGet Start"); psxget = fdlget.open(host, port); System.out.println("Host1 connected"); //getにidのタプルを取り出す PSXReply dataGet = psxget.in(id); System.out.println("dataget"); System.out.println(dataGet.ready()); if(dataGet.ready()){ System.out.println(dataGet); data = dataGet.getData(); fdlget.sync(1); i = data.getInt(); System.out.println(i); } } catch (IOException e) { try { Thread.sleep(10); } catch (InterruptedException e1) { } } } }