Using Persistent Sockets in Tropo.com Applications
September 10th, 2009 by Jason GoeckeWhile Tropo supports RESTful Web Services as a form of moving data to and from the communication cloud, it may not always be fast enough for all applications. There are apps that require the lowest possible latency, for example, when mobile devices become input devices. The unique approach of Tropo, allowing developers to host scripts in our cloud, allows you the ability to write applications that take direct advantage of persistent sockets. This means that you may open the socket once and then stream data to your remote application in realtime without having to establish HTTP connections each time.
I recently created an example of this using Ruby to serve a socket using EventMachine, and then writing a script on Tropo that opens a socket and sends touch-tones (DTMF) down the socket immediately as they come in. Here it is in action:
The code examples may be found here.
Related posts:
- WebSockets and Tropo, Putting the Real-Time in Your Communications
- Tutorial: Click-to-Call applications (w/ conferencing)
- How-To: Distinguish PSTN, Skype, iNum, and SIP in your Tropo applications
- Talking to the Cloud: Build Speech Recognition Applications with Tropo
- Introducing Tropo… a new way to develop voice applications in languages you already know…
Tags: eventmachine, rest, restful, Ruby, sockets
