Mercurial > hg > FederatedLinda
view src/fdl/test/transfer/cluster/TestSend.java @ 57:48bb577a313f
Protocol Engine for cluster
author | axmo |
---|---|
date | Thu, 12 Feb 2009 14:42:27 +0900 |
parents | 0143623aa465 |
children |
line wrap: on
line source
package fdl.test.transfer.cluster; import java.io.IOException; import java.nio.ByteBuffer; import fdl.FederatedLinda; import fdl.PSXLinda; public class TestSend { static PSXLinda psxsend; static FederatedLinda fdlsend; private static int port = 10000; public static void main(String[] args){ int id = 10; int i; String host = "cls001.cs.ie.u-ryukyu.ac.jp"; ByteBuffer send = ByteBuffer.allocate(1024); send.putInt(12); send.flip(); i = send.getInt(); send.rewind(); fdlsend = FederatedLinda.init(); boolean connect = true; while(connect) { try{ System.out.println("TestSend Start"); psxsend = fdlsend.open(host,port); System.out.println("Set Data = " +i); System.out.println("Connect Host1"); psxsend.out(id, send); System.out.println("regist Que"); fdlsend.sync(); System.out.println("Send Data"); connect = false; }catch (IOException e) { try { Thread.sleep(40); } catch (InterruptedException e1) { } } } } }