The code is here
When I run the client code on the server side I get the following error:
info: Server running at 127.0.0.1 on port 3490
info: Received connection...
error: EndOfStream
/home/r3zv/.cache/zig/p/N-V-__8AALSGLBZOZbK7xel3kWHM5On6Z2vi6YojY6nLrqHX/lib/std/Io/Reader.zig:666:26: 0x10eee76 in readSliceAll (std.zig)
if (n != buffer.len) return error.EndOfStream;
^
/home/r3zv/.cache/zig/p/N-V-__8AALSGLBZOZbK7xel3kWHM5On6Z2vi6YojY6nLrqHX/lib/std/Io/Reader.zig:746:5: 0x11f0078 in readAlloc (std.zig)
try readSliceAll(r, dest);
^
/home/r3zv/dev/okibo/src/main.zig:30:25: 0x11e2388 in main (main.zig)
const msg = try reader.interface.readAlloc(gpa, 1024);
^
The comments for readSliceAll mention:
/// Fill `buffer` with the next `buffer.len` bytes from the stream, advancing
/// the seek position.
///
/// Invalidates previously returned values from `peek`.
///
/// If the provided buffer cannot be filled completely, `error.EndOfStream` is
/// returned instead.
///
/// See also:
/// * `peek`
/// * `readSliceShort`
But I am not sure I understand what it means. How does the reader work in this case? The buffer that i provide I assume is used to read data from the client inside it, right?