Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What kind of applications can I make with Websockets?

 
Rogerio Kioshi
Ranch Hand
Posts: 690
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Scott Mattocks
Author
Greenhorn
Posts: 7
5
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
WebSockets are great for games. They allow you to communicate asynchronously with the server and reduce the communications overhead. You are not limited to games though. Any application which needs to send several small pieces of information to the server can benefit from WebSockets. Also, applications that expect to receive information from the server without needing to prompt the server first are great uses of WebSockets.

Streaming of data from sporting events is a great example use case for WebSockets. In a baseball game, there are periods of activity (pitch, hit, throw) follow by periods of inactivity (warm up between innings, signals between pitches, etc). With AJAX polling, you make a lot of calls and get no updates back. Occasionally, one of the calls returns some information. That information is only timely if your polling interval is small enough. Reducing the interval, increases the number of empty responses. Using WebSockets, the server sends data to the client as it happens without the client needing to poll for information. WebSockets reduce overhead and improve application performance in this example.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic