refactor socket code, ensure that we send all a sendmsg's iovs in a single socket send