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 })) {