sock: code cleanup.
sock: fix a corner case where the useful payload size was not correctly calculated.
sock: code cleanup
+ correctly display the error message when sendmsg() fails.