Small changes for troubleshooting stdin.
parent
eb893977e8
commit
ffc7e1a4f2
|
@ -34,9 +34,12 @@ public class ClientPeriodicStdinScanner implements Handler<Long> {
|
||||||
@Override
|
@Override
|
||||||
public void handle(Long event) {
|
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 {
|
try {
|
||||||
int available = inputStream.available();
|
int available = inputStream.available();
|
||||||
if (available > 0) {
|
if (available > 0) {
|
||||||
|
logger.debug("Got available: {}", available);
|
||||||
clientPayloadRemainderBuffer.appendBytes(inputStream.readNBytes(available));
|
clientPayloadRemainderBuffer.appendBytes(inputStream.readNBytes(available));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,6 +59,7 @@ public class ClientPeriodicStdinScanner implements Handler<Long> {
|
||||||
Buffer b = Buffer.buffer(len);
|
Buffer b = Buffer.buffer(len);
|
||||||
b = b.appendBytes(clientPayload, prevIdx, len);
|
b = b.appendBytes(clientPayload, prevIdx, len);
|
||||||
b = b.appendByte((byte)'\n');
|
b = b.appendByte((byte)'\n');
|
||||||
|
logger.info("Sending binary message: {}", b);;
|
||||||
webSocket.writeBinaryMessage(b);
|
webSocket.writeBinaryMessage(b);
|
||||||
prevIdx = idx + eolLength;
|
prevIdx = idx + eolLength;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue