 | Level: Intermediate M. Tim Jones (mtj@mtjones.com), Senior Principal Software Engineer, Emulex Corp.
11 Oct 2005 This tutorial shows how to develop sockets-based networking applications using the Ruby language. You learn Ruby basics as well as the most important classes for sockets programming, and then look at a working chat application that illustrates these fundamentals. The tutorial finishes by exploring the higher-level classes that make it easy to build dynamic Web servers, mail servers and clients, and other application-layer protocols.
In this tutorial
- Review the basics of the sockets API
- Learn how to build networking applications in Ruby
- Examine a simple chat server implemented in Ruby
- Preview some of Ruby's high-level networking classes
Objectives
In this tutorial, you put Ruby to the test by constructing a chat server application that can serve a large and scalable number of clients. By the end of this tutorial, you will know how to use the standard Sockets class to build both client and server applications, as well as how to use classes that simplify sockets programming, including TCPSocket and TCPServer. You will also have tried your hand at building a working, scalable chat server, and you will be familiar with several classes for manipulating application-layer protocols, including HTTP, SMTP, and POP3.
Prerequisites
You should have a basic knowledge of Ruby and basic familiarity with BSD-style sockets.
System requirements
To run the examples in this tutorial, download version 1.8 of Ruby from the Ruby Web site. To build the Ruby interpreter, you need the GNU C compiler (gcc) and configure/make utilities, which are part of any standard GNU/Linux distribution.
Duration
More than two hours
Formats html, pdf
Learn more
|  | |  |