Sequentially write to TPC connection
Hey, I experience errors when multiple async functions write to a TCP (
Deno.Conn
) connection. How can I make sure my data is sent fully, even if it can't be written to the send buffer in one function call?
Using this code, I observed data (buf
) being written partially, then data from other async functions being written before the remainder of the partially written data is written.
2 Replies
Std at least has some APIs named to "writeAll" which may be relevant.
Yes, this "heavily inspired" the code included in the post. It's basically the same minus console.log.