Thursday, November 7, 2013

In Which Azure Makes WebSockets Switch-flip-easy and I add WebSockets to DrawThing

imageI’m finding myself eagerly looking forward to Scott Guthrie’s Azure announcements.  Their team is powering out multiple new features in a 3-week cadence, and always has some real gems each release cycle.  That in its own right is a blog post some day- THAT, my friends, is how to run a project. But for now, one gem that stood out to me in the latest drop was WebSocket support.  I did a little post a while back about using SignalR + Canvas to build a realtime multiplayer tic-tac-toe engine whiteboard, called DrawThing.

What’s nifty about SignalR is that it provides a high-level abstraction of “realtime communications” to your website.  You wire it up, and _it_ handles _how_ to provide the communication based on browser and server support for the common methods for doing this. 

This meant that enabling WebSocket support for DrawThing was simply a matter of flipping the WebSocket switch to ‘On’ for the site in the Azure management console.  Checking Chrome dev tools’ “Network” tab reveals that websockets are indeed being used, and the app seems more responsive.

No comments: