Mercurial > hg > FederatedLinda
changeset 100:270093b61001 fuchita
Fix meta.out(id,data) is not correctly handled.
author | one |
---|---|
date | Wed, 26 May 2010 15:45:56 +0900 |
parents | e3a3bde37dff |
children | d671c78d3757 |
files | src/fdl/FDLindaServ.java src/fdl/FederatedLinda.java src/fdl/MetaLinda.java src/fdl/test/metaTransfer/MetaProtocolEngine_not.java |
diffstat | 4 files changed, 7 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/src/fdl/FDLindaServ.java Wed May 26 15:31:01 2010 +0900 +++ b/src/fdl/FDLindaServ.java Wed May 26 15:45:56 2010 +0900 @@ -88,7 +88,7 @@ public void checkTuple() { // セレクタによる監視 try { - if (selector.select()>0) { + if (selector.selectNow()>0) { // this does not work because #it.remove() is not called. // for(SelectionKey s:selector.selectedKeys()) { // TupleHandler handler = (TupleHandler)s.attachment();
--- a/src/fdl/FederatedLinda.java Wed May 26 15:31:01 2010 +0900 +++ b/src/fdl/FederatedLinda.java Wed May 26 15:45:56 2010 +0900 @@ -131,12 +131,12 @@ * @return 0 * @throws IOException */ - public int sync() throws IOException { + public int sync() { int key_num = 0; queueExec(); try { - if (selector.select()>0) { + if (selector.selectNow()>0) { for (Iterator<SelectionKey> it = selector.selectedKeys().iterator();it.hasNext(); ) { SelectionKey s = it.next(); it.remove(); @@ -166,8 +166,7 @@ * @return 0 * @throws IOException */ - public int sync(long mtimeout) - throws IOException { + public int sync(long mtimeout) { int key_num = 0; queueExec();
--- a/src/fdl/MetaLinda.java Wed May 26 15:31:01 2010 +0900 +++ b/src/fdl/MetaLinda.java Wed May 26 15:45:56 2010 +0900 @@ -115,7 +115,7 @@ * Meta Sync with no wait */ public int sync() { - fdl.queueExec(); + fdl.sync(); fds.checkTuple(); // fdl sync is also handled here return metaSync(); } @@ -125,7 +125,7 @@ * @param timeout wait timeout msec, if 0 wait indefinitely */ public int sync(long timeout) { - fdl.queueExec(); + fdl.sync(); fds.checkTuple(timeout); // fdl sync is also handled here return metaSync(); }
--- a/src/fdl/test/metaTransfer/MetaProtocolEngine_not.java Wed May 26 15:31:01 2010 +0900 +++ b/src/fdl/test/metaTransfer/MetaProtocolEngine_not.java Wed May 26 15:45:56 2010 +0900 @@ -60,11 +60,7 @@ if( port == 10002 ) { metaOpen(10003); metaTrans(); - try { - fdlmeta.sync(); - } catch (IOException e) { - e.printStackTrace(); - } + fdlmeta.sync(); System.out.println("MetaProtocolEngine Connect"); }