From 2b5da1eb9a9cb8dc461b37257e4a6828c31ad072 Mon Sep 17 00:00:00 2001 From: "Tristan B. Velloza Kildaire" Date: Fri, 2 Jun 2023 19:29:53 +0200 Subject: [PATCH] Client - In the `loop()` (the read loop) if built in `unittest` mode then log the read count/status and the current data after the PEEK'd read --- source/birchwood/client/client.d | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/source/birchwood/client/client.d b/source/birchwood/client/client.d index 616dc68..3a1c563 100644 --- a/source/birchwood/client/client.d +++ b/source/birchwood/client/client.d @@ -1012,9 +1012,14 @@ public class Client : Thread /* Receieve at most 512 bytes (as per RFC) */ ptrdiff_t bytesRead = socket.receive(currentData, SocketFlags.PEEK); - import std.stdio; - // writeln(bytesRead); - // writeln(currentData); + version(unittest) + { + import std.stdio; + writeln("(peek) bytesRead: '", bytesRead, "' (status var or count)"); + writeln("(peek) currentData: '", currentData, "'"); + } + + /* FIXME: CHECK BYTES READ FOR SOCKET ERRORS! */ @@ -1088,7 +1093,7 @@ public class Client : Thread scratch.length = bytesRead; this.socket.receive(scratch); - + /* TODO: Yield here and in other places before continue */