TCP battery usage

Hello when my java tcp server send every second « test » to my c++ tcp client on Xcode the battery usage increase. Why?

What is the best way to real time communicate for mobile?

Thank you