You ask that if you are write()message A, then B is on the same socket, is A guaranteed to B? For SOCK_STREAM (e.g. TCP) and SOCK_SEQPACKET (almost never used) sockets, the answer is unqualified yes. For SOCK_DGRAM over the Internet (i.e. UDP packets), the answer is no: packets can be reordered by the network. On one host, the unix domain datagram socket (on all systems that I know) will keep order, but I do not believe that this is guaranteed by any standard, and I am sure there are extreme cases.
: , , , ? : (write/writev/sendto/sendmsg) . , , , .