Omer Aviv
Omer Aviv

Reputation: 284

Updating chat whenever it updates

I scripted some live chat that updates asynchronously with asp:Timer every 5000 m/s (5s). I'd like instead to make it update in everyone's computer whenever it updates instead of waiting 5 seconds every time. Just like Skype and Facebook do. How can I do this?

Upvotes: 0

Views: 47

Answers (1)

Praveen Paulose
Praveen Paulose

Reputation: 5771

Realtime updates from a server to a client are achieved by using Web Sockets. This is the new transport available for realtime updates. Earlier methods like long polling would generally run into problems or a lot of handling in code to run a stable environment.

You could use a third party library called SignalR which uses Web Sockets in the background and provides backward compatibility with earlier methods like long polling. You can read more on this technology here http://www.asp.net/signalr/overview/getting-started/introduction-to-signalr

Upvotes: 2

Related Questions