> now i now that i Should also add +1 for strlen to add the Null character to the string
But you're still wrong.

Just because you managed to send(*) 12 bytes of "hello world\0" doesn't mean that the recv call will get all 12 bytes in a single call.

It's perfectly allowed to receive "hell" on the first call and then "o world\0" on the second call.
Sadly for you, your mis-handling of the code drags it through the brier patch and it is now slowly bleeding to death.

TCP is a stream protocol, which means the only guarantee you have is the order of bytes. The number of bytes sent in a single send() call has NOTHING to do with the number of bytes in some subsequent recv() call. So your thinking of "I've sent a \0, why isn't it working" is just another symptom of the problem.

The Eight Fallacies of Distributed Computing
No doubt your early "success" sending to yourself @127.0.0.1 might lead you to think otherwise, but you only figure out what latency means when you travel .uk to .nz


memset() here, send a \0 there - you seem to be doing EVERYTHING to try and make sure there is a \0 there for you to use, yet all the while you continue to miss the target.
USE the return result of recv() and stop messing about.
It's the only thing which can and will work. All this voodoo will fail you at some point.


(*) I might also add that send() doesn't guarantee to send the whole message in a single call either.