Something that is underestimated in messaging systems are incremental numbers, eg. add + 1 for each message, so the receiving end get 1,2,3,4,5,6 etc, and if it then get 8 it knows it missed the 7th message. And it will know if the messages are out of order. And it can pick up if it goes down by requesting the missing messages.