From 45feccbad8c7306c15137a6003f3df1183d9c2a9 Mon Sep 17 00:00:00 2001 From: Robby Zambito Date: Wed, 7 Jan 2026 22:48:50 -0500 Subject: WAY FASTER but doesn't send all? Seems to not flush the last message --- src/Server/Client.zig | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) (limited to 'src/Server/Client.zig') diff --git a/src/Server/Client.zig b/src/Server/Client.zig index 047f38d..a7dd007 100644 --- a/src/Server/Client.zig +++ b/src/Server/Client.zig @@ -1,5 +1,6 @@ -const parse = @import("parse.zig"); -const Message = parse.Message; +const message = @import("message.zig"); +const parse = message.parse; +const Message = message.Message; const std = @import("std"); const Queue = std.Io.Queue; @@ -68,17 +69,7 @@ pub fn start(self: *Client, io: std.Io) !void { // }; // switch (msg) { // .MSG => |m| { - // try self.to_client.print( - // "MSG {s} {s} {s} {d}\r\n", - // .{ - // m.subject, - // m.sid, - // m.reply_to orelse "", - // m.payload.len, - // }, - // ); - // try m.payload.write(self.to_client); - // try self.to_client.print("\r\n", .{}); + // }, // .HMSG => |hmsg| { // try self.to_client.print("HMSG {s} {s} {s} {d} {d}\r\n", .{ @@ -106,9 +97,7 @@ pub fn start(self: *Client, io: std.Io) !void { // _ = try self.to_client.write("PONG\r\n"); // }, // .INFO => |info| { - // _ = try self.to_client.write("INFO "); - // try std.json.Stringify.value(info, .{}, self.to_client); - // _ = try self.to_client.write("\r\n"); + // }, // .@"-ERR" => |s| { // _ = try self.to_client.print("-ERR '{s}'\r\n", .{s}); @@ -177,8 +166,8 @@ test send { } } -pub fn next(self: *Client, allocator: std.mem.Allocator) !Message { - return parse.next(allocator, self.from_client); +pub fn next(self: *Client) !message.Control { + return parse.control(self.from_client); } test next { -- cgit