Mercurial > hg > FederatedLinda
changeset 64:3e051060d845
fix senddata
author | axmo |
---|---|
date | Thu, 26 Feb 2009 08:22:08 +0900 |
parents | b342dc9b52eb |
children | cc860e8beb8f |
files | src/fdl/test/transfer/cluster/MetaProtocolEngine.java |
diffstat | 1 files changed, 23 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- a/src/fdl/test/transfer/cluster/MetaProtocolEngine.java Tue Feb 24 17:59:45 2009 +0900 +++ b/src/fdl/test/transfer/cluster/MetaProtocolEngine.java Thu Feb 26 08:22:08 2009 +0900 @@ -1,7 +1,7 @@ package fdl.test.transfer.cluster; import java.io.*; -import java.net.InetAddress; +//import java.net.InetAddress; import java.nio.ByteBuffer; import java.text.SimpleDateFormat; import java.util.Date; @@ -56,7 +56,12 @@ while(connect){ try { initConnect(); + transfer = DF.format(new Date()); + transferlong = new Date().getTime(); + System.out.println("transfer Time => "+transfer); + for(int l=0; l<1000; l++){ transfer(); + } dataChk(); write(); connect = false; @@ -88,8 +93,12 @@ private void sendData() throws IOException{ boolean connectSend = true; ByteBuffer send = ByteBuffer.allocate(bufsize); - int localhost = InetAddress.getLocalHost().hashCode(); - send.putInt(localhost); + byte[] fdata = new byte[bufsize]; +// fdata = InetAddress.getLocalHost().getAddress(); + for(int n=0; n < fdata.length; n++ ){ + fdata[n] = 1; + } + send.put(fdata); send.flip(); while(connectSend){ psxget.out(id, send); @@ -106,14 +115,7 @@ while (running) { if(in.ready()){ data = in.getData(); - int i = data.getInt(); - data.rewind(); - System.out.println("transfer Data => "+i); - //outしたbytebufferの変更をこれ以降やっちゃいけない psxsend.out(id,data); - transfer = DF.format(new Date()); - transferlong = new Date().getTime(); - System.out.println("transfer Time => "+transfer); System.out.println("connect to => "+host); psxsend.sync(1); running = false; @@ -126,19 +128,24 @@ public void dataChk() throws IOException{ fdlmeta.sync(1); boolean running2 = true; - ByteBuffer data2 = ByteBuffer.allocate(bufsize); +// ByteBuffer data2 = ByteBuffer.allocate(bufsize); PSXReply in2 = psxget.in(id); - int localhost2 = InetAddress.getLocalHost().hashCode(); +// byte[] fdata2 = new byte[bufsize]; +// byte[] fdata3 = new byte[bufsize]; +// fdata = InetAddress.getLocalHost().getAddress(); +// for(int n=0; n < fdata2.length; n++ ){ +// fdata2[n] = 1; +// } while (running2) { psxget.sync(1); if(in2.ready()) { - data2 = in2.getData(); - int i = data2.getInt(); - if (i == localhost2){ +// data2 = in2.getData(); +// data2.get(fdata3); +// if (fdata2 == fdata3){ time = DF.format(new Date()); timelong = new Date().getTime(); System.out.println("Around Time => "+time); - } +// } running2 = false; break; }