debugging udp

This commit is contained in:
Jeremy Penner 2021-12-20 12:25:28 -05:00
parent 3e87f231bc
commit d070e8adb0
2 changed files with 2 additions and 2 deletions

View file

@ -134,9 +134,9 @@
:write-batch (fn [self addr-to-data]
(let [blocks (icollect [addr data (pairs addr-to-data)] {: addr :len (+ (length data) 6) : data})]
(each [_ batch (ipairs (self:split-batches blocks 1450))]
(print "writing batch of size" (length batch))
(let [msg (.. (int16-to-bytes (length batch))
(table.concat (icollect [_ {: addr : data} (ipairs batch)] (.. (int32-to-bytes addr) (int16-to-bytes (length data)) data))))]
(print "writing batch of size" (length batch) (length msg))
(self:send self.cmd.write msg self.handle-ack)))))
:write (fn [self addr data] (self:write-batch {addr data}))
:pause (fn [self] (self:send self.cmd.pause (int16-to-bytes 0xffff) self.handle-ack))

File diff suppressed because one or more lines are too long