Thanks for the help, but I've figured it out, and the answer simply foolish :wtf:. I wasn't closing the connection correctly, hence the lack of buffer flushing As for the repeat message, it wasn't repeating. The message was being stored in a buffer with a static pointer, and because I neglected to check the data size returned from recv I was assuming the data pointed to was the latest message, but recv was in fact returning 0.
When I die I'd like to go peacefully in my sleep like my father, not screaming in terror like his passengers!!!