aboutsummaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
Diffstat (limited to 'client')
-rw-r--r--client/main.ha13
1 files changed, 9 insertions, 4 deletions
diff --git a/client/main.ha b/client/main.ha
index fa63004..242a101 100644
--- a/client/main.ha
+++ b/client/main.ha
@@ -87,16 +87,21 @@ export fn main() void = {
case void => yield;
case let op: drawing::op =>
drawing::perform(pictures, op);
- drawing::send_op(conn, op)!;
+ packet_reader::send(conn, op: packet_reader::packet_drawop)!;
};
const n = poll::poll(pollfd, poll::NONBLOCK)!;
if (n > 0) {
fmt::println("data available")!;
packet_reader::read(&packet_reader, conn)!;
- for (const packet_bytes => packet_reader::next(&packet_reader)) {
- const op = drawing::deser_op(packet_bytes);
- drawing::perform(pictures, op);
+ for (const packet => packet_reader::next(&packet_reader)!) {
+ match (packet) {
+ case let op: packet_reader::packet_drawop =>
+ const opc = op as drawing::op_circle;
+ drawing::perform(pictures, opc);
+ case =>
+ abort("other packet not supported yet");
+ };
};
};