Only check to make sure that the full number of bytes were sent if the send operation succeeded. I'm still not convinced that send_done() works correctly, but making other changes that look correct causes assertion failures.