In theory, we could encode multiple records in the same buffer without flushing but flushing means we don't have to deal with the insufficient buffer case where we would need to flush anyway.
The PR avoids copy-shifting every ApplicationData by 5 bytes, and wraps a bunch of raw slice operations. It also flushed before sending the close alert so all writes are flushed from now on.
Closes #91 Closes #92
In theory, we could encode multiple records in the same buffer without flushing but flushing means we don't have to deal with the insufficient buffer case where we would need to flush anyway.
The PR avoids copy-shifting every ApplicationData by 5 bytes, and wraps a bunch of raw slice operations. It also flushed before sending the close alert so all writes are flushed from now on.