title: What are Long-Polling, Websockets, Server-Sent Events (SSE) and Comet?
body: <p>I have tried reading some articles, but I am not very clear on the concepts yet.</p>
  
  <p>Would someone like to take a shot at explaining to me what these technologies are:</p>
  
  <ol>
  <li>Long Polling</li>
  <li>Server-Sent Events</li>
  <li>Websockets</li>
  <li>Comet</li>
  </ol>
  
  <p>One thing that I came across every time was, the server keeps a connection open and pushes data to the client. How is the connection kept open, and how does the client get the pushed data? (How does the client use the data, maybe some code might help?)</p>
  
  <p>Now, which one of them should I use for a real-time app. I have been hearing a lot about websockets (with socket.io [a node.js library]) but why not PHP?</p>