title: How expensive is maintaining a TCP socket in java
body: <p>I have currently implemented a heartbeat mechanism for my project and I am using TCP as my underlying connectivity. I was wondering how expensive is maintaining a tcp connection. Each slave sends a heartbeat every 5 seconds to the master(yes i know its way to often but i have a good reason to do so). So I was wondering should I constantly create a new connection or should I keep the connection open. Because if I keep the open connection then in that case I can just handle the exception. But since I need to know every 5 seconds wether or not a slave is down should I be re establishing the connection or just keep it open. Thanks in advance.</p>