socket.c: use sendmsg and recvmsg for IO