added client server shared

This commit is contained in:
vfs committed 2025-12-21 23:02:59 +01:00
1 parent 6f9de0f566
commit 7d60843598
10 files changed
+482

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
const std = @import("std");
pub const SERVER_PORT: u16 = 1337;
pub const Hello = struct {
msg: []const u8,
};
pub fn sendHello(writer: *std.io.Writer, hello: Hello) !void {
try writer.print("{s}\n", .{hello.msg});
}
pub fn recvLine(reader: *std.io.Reader) ![]u8 {
return try reader.takeDelimiterExclusive('\n');
}