From c2b37f5645224e5410fd57e5792a5de25b6afb52 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Sat, 19 Nov 2022 20:43:14 -0600 Subject: [PATCH] WIP --- 6.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/6.ts b/6.ts index 3539d13..651fc82 100644 --- a/6.ts +++ b/6.ts @@ -21,7 +21,9 @@ function chatSession(conn: Deno.Conn) { async function serve(conn: Deno.Conn) { const reader = new BufReader(conn); - reader.peek(1); + const type = await reader.peek(1); + if (!type) throw new Error("failed to peek start of packet"); + console.log(type); } for await (const conn of Deno.listen({ port: PORT })) {