From 90103d5c499f338245a2e47e4cdf9fc80f4dd400 Mon Sep 17 00:00:00 2001 From: delvh Date: Tue, 9 Jun 2020 18:18:13 +0200 Subject: [PATCH] Added debugging statement when sending an object --- src/main/java/envoy/server/net/ObjectWriteProxy.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/envoy/server/net/ObjectWriteProxy.java b/src/main/java/envoy/server/net/ObjectWriteProxy.java index 238e817..bc37885 100755 --- a/src/main/java/envoy/server/net/ObjectWriteProxy.java +++ b/src/main/java/envoy/server/net/ObjectWriteProxy.java @@ -37,14 +37,16 @@ public class ObjectWriteProxy { */ public void write(long recipientSocketID, Object obj) throws IOException { // Create message targeted at the client - Message response = writeProxy.getMessage(); + final Message response = writeProxy.getMessage(); response.socketId = recipientSocketID; + System.out.println("Sending object " + obj); + // Serialize object to byte array - byte[] objBytes = SerializationUtils.writeToByteArray(obj); + final byte[] objBytes = SerializationUtils.writeToByteArray(obj); // Acquire object length in bytes - byte[] objLen = SerializationUtils.intToBytes(objBytes.length); + final byte[] objLen = SerializationUtils.intToBytes(objBytes.length); response.writeToMessage(objLen); response.writeToMessage(objBytes);