Our last piece mentioned some standard technologies, newly supported in Coldfusion, which facilitate push-style communication on the web. We’ll now take a closer look at my favorite, WebSocket, and see how to wield it the Coldfusion way.
WebSocket, quoting wikipedia,
is a web technology providing for bi-directional, full-duplex communications channels over a single TCP connection. WebSocket is designed to be implemented in web browsers and web servers, but it can be used by any client or server application. The WebSocket protocol makes possible more interaction between a browser and a web site, facilitating live content and the creation of real-time games. This is made possible by providing a standardized way for the server to send content to the browser without being solicited by the client, and allowing for messages to be passed back and forth while keeping the connection open. In this way a two-way (bi-directional) ongoing conversation can take place between a browser and the server.
WebSocket is just a protocol–its only dependencies are TCP and a handful of browser capabilities–so anyone’s platform of choice ought to be able to support it. I’ll begin Part 2b by showing how other popular platforms speak WebSocket, and then conclude with a treatment of Coldfusion’s approach and a few nifty example applications to motivate further exploration.