diff src/fdl/PSXLindaImpl.java @ 90:9cdc24bae625

ring test
author one
date Sat, 13 Feb 2010 04:16:15 +0900
parents b658ff1eb90f
children 7bf2eeea23a0
line wrap: on
line diff
--- a/src/fdl/PSXLindaImpl.java	Thu Feb 11 16:26:04 2010 +0900
+++ b/src/fdl/PSXLindaImpl.java	Sat Feb 13 04:16:15 2010 +0900
@@ -65,12 +65,6 @@
 			if (debug) {
 			    fdl.log(Level.INFO,"waiting for connect");
 			}
-			if (false) {
-				try {
-					wait(2000);
-				} catch (InterruptedException e) {
-				}
-			}
 		}
 		fdl.log(Level.INFO,"Linda client connect to "+socketChannel);
         socketChannel.register(selector,SelectionKey.OP_READ,this);
@@ -117,6 +111,15 @@
 		}
 	}
 
+	public void close() {
+		if (socketChannel != null) {
+			try {
+				socketChannel.close();
+			} catch (IOException e) {
+			}
+		}
+	}
+
 	private void checkConnect(String s) {
 		fdl.log(Level.INFO, "Connected:"+ s +": "
 		    +socketChannel.isConnected());
@@ -180,7 +183,6 @@
 
 	public void send(ByteBuffer command, ByteBuffer data) {
 		PSX.send(socketChannel, command, data);
-		fdl.log(Level.INFO,"Linda client sent data to "+socketChannel + " " + new String(data.array()));
 	}