title: Cron jobs in PHP for Socket programming
body: <p>I am developing one website to track the GPS device(s). I am configuring the devices (GPS) to the host name and specific port number to establish the connection to my hosted server and send the coordinates in regular interval like 1 minute-5 minutes.</p>
  
  <p>I wrote a PHP page to start the socket server to accept the requests from socket clients (GPS devices) and parse them before storing in the database. Up to this working fine.</p>
  
  <p>My problems are:</p>
  
  <ol>
  <li><p>I need to keep on open the listener page, If I do this from cron jobs they have limitation like cron job can run for few minutes only.</p></li>
  <li><p>In case the Server listener page stops/aborted, the port is not closing automatically as it is aborted. To use the same port we need to restart the system which is not possible when hosting.</p></li>
  </ol>
  
  <p>Please help what is the correct approach.</p>
  
  <p>My Major issue now is how to close the opened socket port when the page is aborted.</p>