O'Reilly logo

Ruby Phrasebook by Jason Clinton

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 13. Working with Networking and Sockets

Ruby has a robust socket library included. This, coupled with the built-in threading, can be used to accomplish simple socket-based communications between Ruby processes or even something as significant as a web server.

For example, suppose that you implemented a library that decodes statuses and encodes commands for a Lego™ Mindstorms™ robot—as my colleague has done in a project introducing his son to programming—and you want to implement a network-controllable server for this interface, one that is sophisticated enough to handle as many as 30 students monitoring the robot. How might such a thing be done simply? Perhaps this question is most pragmatically answered by an implementation of a client-server ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required