comparison 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
comparison
equal deleted inserted replaced
40:20616fe4d28a 41:f9334781344a
23 public void run() { 23 public void run() {
24 MessagePack msgpack = new MessagePack(); 24 MessagePack msgpack = new MessagePack();
25 while (true) { 25 while (true) {
26 try { 26 try {
27 Command cmd = connection.sendQueue.take(); 27 Command cmd = connection.sendQueue.take();
28 if (cmd.type == CommandType.FINISH) { 28 switch (cmd.type) {
29 case CLOSE:
30 connection.socket.close();
31 return;
32 case FINISH:
29 System.exit(0); 33 System.exit(0);
30 return; 34 return;
31 } 35 }
32 CommandMessage cmdMsg = convert(cmd); 36 CommandMessage cmdMsg = convert(cmd);
33 byte[] buf = msgpack.write(cmdMsg); 37 byte[] buf = msgpack.write(cmdMsg);