TCP is stream-based, which means you send bytes without them necessarily being in a \"message\", so the receiver may get half a message or one and two thirds of messages.
You could use ØMQ (ZeroMQ) as your messaging infrastructure. ZeroMQ provides reliable message passing on top of TCP and other transport mechanisms. It has a C API and a comprehensive guide.
Note that you would have to use an external library for all peers, but you said that is OK with you.