Small changes for troubleshooting stdin.

master
Tomasz Półgrabia 2024-12-27 22:58:09 +01:00
parent eb893977e8
commit ffc7e1a4f2
1 changed files with 4 additions and 0 deletions

View File

@ -34,9 +34,12 @@ public class ClientPeriodicStdinScanner implements Handler<Long> {
@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<Long> {
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;
}