transport layer better, to avoid draining the window size when sending large packets. I also fixed the return code for it to return the number of bytes handled in this single invoke (and not the cumulative amount).