Search code examples
phpsocketschatcometpolling

PHP instant messaging methods


I want to make an IM so that user's can send instant messages to each others on the same page like a chat. Users can choose that who can see their messages. Its for task management . What is the best method that I should use for. I'm using php. Is php sockets usefull for this? or Polling, Comet, php output buffer or javascript timer(timer is easy but not fast).


Solution

  • The most frequently used method is called COMET.

    Here is a PHP implementation: How to implement COMET with PHP

    In the HTML5 specification there are something called websockets that many browsers already have implemented. Here is a PHP project supporting websockets: phpwebsocket. There are some javascript libraries which can use a flash component if the browser do not support websockets (and therefore be backwards compatible)

    imho webSockets is the way to go, although PHP might not be the most suitable backend to handle them.