diff src/alice/daemon/OutboundTcpConnection.java @ 41:f9334781344a

add close api
author kazz <kazz@cr.ie.u-ryukyu.ac.jp>
date Thu, 02 Feb 2012 10:48:39 +0900
parents b5a21baf0b07
children 73158dc54c59
line wrap: on
line diff
--- a/src/alice/daemon/OutboundTcpConnection.java	Tue Jan 31 15:19:35 2012 +0900
+++ b/src/alice/daemon/OutboundTcpConnection.java	Thu Feb 02 10:48:39 2012 +0900
@@ -25,7 +25,11 @@
 		while (true) {
 			try {
 				Command cmd = connection.sendQueue.take();
-				if (cmd.type == CommandType.FINISH) {
+				switch (cmd.type) {
+				case CLOSE:
+					connection.socket.close();
+					return;
+				case FINISH:
 					System.exit(0);
 					return;
 				}