Mercurial > hg > Database > Christie
comparison src/main/java/christie/daemon/IncomingTcpConnection.java @ 14:f2b30b47ef67
RemotePutTest is working
author | Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 11 Jan 2018 18:02:59 +0900 |
parents | bcd4f2c19185 |
children | 186a86dc4c8a |
comparison
equal
deleted
inserted
replaced
13:bcd4f2c19185 | 14:f2b30b47ef67 |
---|---|
36 return; | 36 return; |
37 } | 37 } |
38 while (true) { | 38 while (true) { |
39 try { | 39 try { |
40 Command cmd = null; | 40 Command cmd = null; |
41 DataGear dg = null; | |
42 RemoteMessage msg = unpacker.read(RemoteMessage.class); | 41 RemoteMessage msg = unpacker.read(RemoteMessage.class); |
43 CommandType type = CommandType.getCommandTypeFromId(msg.type); | 42 CommandType type = CommandType.getCommandTypeFromId(msg.type); |
44 int dataSize = unpacker.readInt(); | 43 int dataSize = unpacker.readInt(); |
45 byte[] data = new byte[dataSize]; | 44 byte[] data = new byte[dataSize]; |
46 switch (type) { | 45 switch (type) { |
47 case PUT: | 46 case PUT: |
48 connection.socket.getInputStream().read(data); | 47 connection.socket.getInputStream().read(data); |
49 try { | 48 try { |
50 cgms.get(msg.cgmName).getDGM().put(msg.key, new DataGear(data, Class.forName(msg.clazz))); | 49 DataGear dg = new DataGear(); |
50 dg.setMessagePack(data, Class.forName(msg.clazz)); | |
51 cgms.get(msg.cgmName).getLocalDGM().put(msg.key, dg); | |
51 } catch (ClassNotFoundException e) { | 52 } catch (ClassNotFoundException e) { |
52 e.printStackTrace(); | 53 e.printStackTrace(); |
53 } | 54 } |
54 | 55 |
55 break; | 56 break; |