Mercurial > hg > Database > Christie
changeset 119:558daa2f106e
add debug message
author | akahori |
---|---|
date | Mon, 10 Dec 2018 11:20:36 +0900 |
parents | daf37151dd97 |
children | 7ca232bc1009 |
files | src/main/java/christie/daemon/Connection.java src/main/java/christie/daemon/IncomingTcpConnection.java src/main/java/christie/datagear/command/ConvertedCommand.java |
diffstat | 3 files changed, 28 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/christie/daemon/Connection.java Fri Dec 07 23:29:18 2018 +0900 +++ b/src/main/java/christie/daemon/Connection.java Mon Dec 10 11:20:36 2018 +0900 @@ -1,5 +1,6 @@ package christie.daemon; +import java.awt.*; import java.net.Socket; import java.nio.ByteBuffer; import java.util.concurrent.LinkedBlockingQueue; @@ -58,11 +59,15 @@ }*/ public synchronized void write(Command cmd) { ByteBuffer buffer = cmd.convert(); + try { while (buffer.hasRemaining()) { socket.getChannel().write(buffer); } + System.out.println("write : " + cmd.key); + } catch (Exception e) { + e.printStackTrace(); } }
--- a/src/main/java/christie/daemon/IncomingTcpConnection.java Fri Dec 07 23:29:18 2018 +0900 +++ b/src/main/java/christie/daemon/IncomingTcpConnection.java Mon Dec 10 11:20:36 2018 +0900 @@ -50,7 +50,7 @@ e.printStackTrace(); } if (in == null) { - System.out.println("is null"); + System.out.println("return"); return; } @@ -60,7 +60,7 @@ RemoteMessage msg = objectMapper.readValue(in, RemoteMessage.class); CommandType type = CommandType.getCommandTypeFromId(msg.type); - System.out.println("msgkey " + msg.key); + System.out.println("read : " + msg.key); switch (type) { case PUT:
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/main/java/christie/datagear/command/ConvertedCommand.java Mon Dec 10 11:20:36 2018 +0900 @@ -0,0 +1,21 @@ +package christie.datagear.command; + +public class ConvertedCommand { + byte[] command; + byte[] data; + + public ConvertedCommand(){} + + public ConvertedCommand(byte[] command, byte[] data){ + this.command = command; + this.data = data; + } + + public byte[] getData() { + return data; + } + + public byte[] getCommand(){ + return command; + } +}