4

In my application I have an inbox. If a new message arrives I need to increment the unread count. Do I need to make the database connection for every second to find out if a new message has arrived? Are there any other methods?

Anthony
  • 34,084
  • 23
  • 90
  • 154
svk
  • 4,205
  • 16
  • 56
  • 97

2 Answers2

4

Use Comet, and load the changes when new mail comes in.

Ignacio Vazquez-Abrams
  • 699,552
  • 132
  • 1,235
  • 1,283
2

Comet is the name given to various types of "server-push" methods that can be used to do what you are looking for. The most compatible of the comet methods is XHR Long Polling.

If you want to try out a specific comet tool, check out jquery comet, which was developed by a SO member. He discusses his plugin at another question.

Community
  • 1
  • 1
Anthony
  • 34,084
  • 23
  • 90
  • 154