Added debugging statement when sending an object

This commit is contained in:
delvh 2020-06-09 18:18:13 +02:00 committed by kske
parent 5ea896d52b
commit 05f4fd33f5

View File

@ -37,14 +37,16 @@ public class ObjectWriteProxy {
*/ */
public void write(long recipientSocketID, Object obj) throws IOException { public void write(long recipientSocketID, Object obj) throws IOException {
// Create message targeted at the client // Create message targeted at the client
Message response = writeProxy.getMessage(); final Message response = writeProxy.getMessage();
response.socketId = recipientSocketID; response.socketId = recipientSocketID;
System.out.println("Sending object " + obj);
// Serialize object to byte array // Serialize object to byte array
byte[] objBytes = SerializationUtils.writeToByteArray(obj); final byte[] objBytes = SerializationUtils.writeToByteArray(obj);
// Acquire object length in bytes // Acquire object length in bytes
byte[] objLen = SerializationUtils.intToBytes(objBytes.length); final byte[] objLen = SerializationUtils.intToBytes(objBytes.length);
response.writeToMessage(objLen); response.writeToMessage(objLen);
response.writeToMessage(objBytes); response.writeToMessage(objBytes);