added client server shared
This commit is contained in:
1 parent
6f9de0f566
commit
7d60843598
10 files changed
+482
No files matched your search
@@ -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');
|
||||
}
|
||||
Reference in new issue
Block a user