summaryrefslogtreecommitdiff
path: root/src/Server/Client.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/Server/Client.zig')
-rw-r--r--src/Server/Client.zig25
1 files changed, 7 insertions, 18 deletions
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 {