From ffc7e1a4f2055af320eddea99531990c25d9deb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20P=C3=B3=C5=82grabia?= Date: Fri, 27 Dec 2024 22:58:09 +0100 Subject: [PATCH] Small changes for troubleshooting stdin. --- .../ch/polgrabia/demos/client/ClientPeriodicStdinScanner.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/2024/08/chat_demo1/chat_demo1_web/src/main/java/ch/polgrabia/demos/client/ClientPeriodicStdinScanner.java b/2024/08/chat_demo1/chat_demo1_web/src/main/java/ch/polgrabia/demos/client/ClientPeriodicStdinScanner.java index d49a565..6dd178f 100644 --- a/2024/08/chat_demo1/chat_demo1_web/src/main/java/ch/polgrabia/demos/client/ClientPeriodicStdinScanner.java +++ b/2024/08/chat_demo1/chat_demo1_web/src/main/java/ch/polgrabia/demos/client/ClientPeriodicStdinScanner.java @@ -34,9 +34,12 @@ public class ClientPeriodicStdinScanner implements Handler { @Override public void handle(Long event) { { + // TODO this doesn't seem to be working on wsl environment. Needs to be resolved or changed how it + // fetches the input try { int available = inputStream.available(); if (available > 0) { + logger.debug("Got available: {}", available); clientPayloadRemainderBuffer.appendBytes(inputStream.readNBytes(available)); } @@ -56,6 +59,7 @@ public class ClientPeriodicStdinScanner implements Handler { Buffer b = Buffer.buffer(len); b = b.appendBytes(clientPayload, prevIdx, len); b = b.appendByte((byte)'\n'); + logger.info("Sending binary message: {}", b);; webSocket.writeBinaryMessage(b); prevIdx = idx + eolLength; }