title: Socket connections and Polling. Which is a better solution in terms of battery life?
body: <p>So... I'm making an application for Android. The application needs to send and receive realtime chat data (needs to be a socket) but it also needs to send commands (which don't as the client knows when it is sending something). </p>
  
  <p>I need to know what is a better solution in terms of saving the user's battery.</p>
  
  <p><strong>a)</strong> Opening and Closing the connection every time a command is sent, if the chat tab is opened then keep the connection constant. </p>
  
  <p><strong>b)</strong> Keep the connection constant all the time. </p>
  
  <p>I've taken a look around the internet but have gotten mixed answers, some say keeping a persistent connection is bad for battery life and others say that it isn't (Example: <em>"Are you asking if holding a TCP connection open will drain battery-life? Maybe I am WAY off here but, holding a connection open shouldn't waste battery life... If you think it will I would love to know where you got that information. It sounds SO strange to me."</em>)</p>
  
  <p>Or if there is another solution that would be better. I don't think that Google's C2DM would be very useful at all in this situation either. </p>
  
  <p>Basically, what drains the battery more: having a persistent connection, or opening and closing the connection unless the chat tab is open?</p>
  
  <p>Thanks!</p>