title: TCP IP Listener Android
body: <p>Here is the idea behind what I am trying to accomplish, I am currently communicating with Bluetooth sensors and sending the data at periodic intervals to a remote server over Wi-Fi, now in between transmissions I put the system in sleep mode to save power.</p>
  
  <p>However, I want my processing thread to be interrupted from it's sleep upon reception of a packet from the server. I know I can do this simply by creating another thread in an infinite work loop and waking it up to check for incoming data from the socket upon time intervals, but I was wondering whether there was a nicer way of accomplishing this, e.g. registering a listener, starting a background service to check for reception, creating a custom broadcast receiver ... etc. </p>
  
  <p>I have tried searching online with no success, I don't want the code to do this, but maybe a few links to point me in the right direction so that I can do it myself.
  Thanks</p>