changeset 42:92aeb6e34683

implements close exception
author kazz <kazz@cr.ie.u-ryukyu.ac.jp>
date Fri, 03 Feb 2012 14:59:05 +0900
parents f9334781344a
children ff33af300567
files scripts/log.rb src/alice/daemon/IncomingTcpConnection.java src/alice/topology/manager/StartTopologyManager.java
diffstat 3 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/log.rb	Thu Feb 02 10:48:39 2012 +0900
+++ b/scripts/log.rb	Fri Feb 03 14:59:05 2012 +0900
@@ -12,7 +12,7 @@
     end
     if header[5] == "TAKE" || header[5] == "PEEK" then
       puts '"' + data[4].split(" ")[0].split("=")[1].split(".")[-1] + '"' + ' [shape="box", fontname="Ricty"]'
-      print '"' + header[3] + "." + data[1] + '"' + ' [shape="box", fontname="Ricty"]'
+      print '"' + header[3] + "." + data[1] + '"' + ' [fontname="Ricty"]'
       print '"' + header[3] + "." + data[1] + '"'
       print " -> "
       print '"' + data[4].split(" ")[0].split("=")[1].split(".")[-1] + '"'
@@ -21,7 +21,7 @@
     end
     if header[5] == "PUT" || header[5] == "UPDATE" then
       puts '"' + data[4].split(" ")[0].split("=")[1].split(".")[-1] + '"' + ' [shape="box", fontname="Ricty"]'
-      puts '"' + header[3] + "." + data[1] + '"' + ' [shape="box", fontname="Ricty"]'
+      puts '"' + header[3] + "." + data[1] + '"' + ' [fontname="Ricty"]'
       print '"' + data[4].split(" ")[0].split("=")[1].split(".")[-1] + '"'
       print " -> "
       print '"' + header[3] + "." + data[1] + '"'
--- a/src/alice/daemon/IncomingTcpConnection.java	Thu Feb 02 10:48:39 2012 +0900
+++ b/src/alice/daemon/IncomingTcpConnection.java	Fri Feb 03 14:59:05 2012 +0900
@@ -2,6 +2,7 @@
 
 import java.io.IOException;
 import java.nio.ByteBuffer;
+import java.nio.channels.ClosedChannelException;
 import java.nio.channels.SocketChannel;
 
 import org.msgpack.MessagePack;
@@ -78,6 +79,8 @@
 				default:
 					break;
 				}
+			} catch (ClosedChannelException e) {
+				return;
 			} catch (IOException e) {
 				e.printStackTrace();
 			}
--- a/src/alice/topology/manager/StartTopologyManager.java	Thu Feb 02 10:48:39 2012 +0900
+++ b/src/alice/topology/manager/StartTopologyManager.java	Fri Feb 03 14:59:05 2012 +0900
@@ -53,13 +53,13 @@
 					LinkedList<NodeInfo> sources = topology.get(target);
 					NodeInfo nodeInfo = new NodeInfo(source, connection);
 					sources.add(nodeInfo);
-					hash.put(source + target, nodeInfo);
+					hash.put(source + "," + target, nodeInfo);
 				}
 				for (Edge edge : edges) {
 					String connection = edge.getAttribute("label");
 					String source = edge.getSource().getNode().getId().getId();
 					String target = edge.getTarget().getNode().getId().getId();
-					NodeInfo nodeInfo = hash.get(target + source);
+					NodeInfo nodeInfo = hash.get(target + "," + source);
 					if (nodeInfo != null) {
 						nodeInfo.reverseName = connection;
 					}