comparison src/alice/daemon/OutboundTcpConnection.java @ 16:433e601a8e28

network bug fix
author kazz <kazz@cr.ie.u-ryukyu.ac.jp>
date Sun, 15 Jan 2012 12:17:30 +0900
parents e3f1b21718b0
children b5a21baf0b07
comparison
equal deleted inserted replaced
15:45e98e74db96 16:433e601a8e28
26 CommandMessage cmdMsg = convert(connection.sendQueue.take()); 26 CommandMessage cmdMsg = convert(connection.sendQueue.take());
27 byte[] buf = msgpack.write(cmdMsg); 27 byte[] buf = msgpack.write(cmdMsg);
28 ByteBuffer buffer = ByteBuffer.allocateDirect(4 + buf.length); 28 ByteBuffer buffer = ByteBuffer.allocateDirect(4 + buf.length);
29 buffer.putInt(buf.length); 29 buffer.putInt(buf.length);
30 buffer.put(buf); 30 buffer.put(buf);
31 buffer.flip();
31 connection.socket.getChannel().write(buffer); 32 connection.socket.getChannel().write(buffer);
32 } catch (InterruptedException e) { 33 } catch (InterruptedException e) {
33 e.printStackTrace(); 34 e.printStackTrace();
34 } catch (IOException e) { 35 } catch (IOException e) {
35 e.printStackTrace(); 36 e.printStackTrace();