0

I wondered how pages like facebook.com works. When I look at firebug output in firefox to xhttprequests, there are many of closed connections, but there are also many opened connections. There must be a better way then asking server "are there any new messages" every second, but in other way, http header contains length of html body in bytes and browser downloads content in this exact length, so request couldn't work that way.

Buhake Sindi
  • 87,898
  • 29
  • 167
  • 228
Kyry
  • 1

2 Answers2

1

Have a look at this Comet

and you can find some examples here, How do I implement basic "Long Polling"?

Or the new way to do things Websockets ( and now with flash fallback )

Community
  • 1
  • 1
Pantelis
  • 6,086
  • 1
  • 18
  • 21
0

You can create live-ajax connection and you don't need to create new and new connections

Artem Oliynyk
  • 3,517
  • 1
  • 14
  • 11