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 ...
Get Ruby Phrasebook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.