I am working on a private messasing functionality for my site, is there a way to get push notifications from the server, that the user has received a new message?
th
There are a lot of good libraries that help you to do this
XMPP - BOSH is a good combination which I use on my websites
XMPP servers
Ejabberd, Openfire I use ejabberd
You can use Strophe along with Ejabberd to capture notifications in javascript. If you want to send notifications from code
There are libraries like JAXL and XMPPHP that let you do this, but this is in PHP.
You might want to look into XMPP and BOSH. Very comet like and ejabberd combined with nginx can maintain 1000's of connections on a very small box.
Take a look at one of my projects www.vooices.us to see what we have done with XMPP and BOSH.
http://www.ejabberd.im/
http://github.com/ssoper/jquery-bosh/tree/master JQueryBosh - to enable quick and easy access to XMPP over HTTP
It is relativly easy to set up and install.
Paul.
There isn't any way for the server to push information to the client, but you could always use Comet. Yes, you'd be polling the server, but not constantly. You'd keep each connection open for about 30 seconds (that's the interval I've always seen used) and then open a new connection when needed.
EDIT: Adobe Flash allows persistent connections to the server, so you could use that. See this article for details.
Sounds like the Comet probably links to some useful stuff (Look into Google's GTalk):
http://alex.dojotoolkit.org/2006/02/what-else-is-burried-down-in-the-depths-of-googles-amazing-javascript/