DæmonNews: News and views for the BSD community

Daemon News Ezine BSD News BSD Mall BSD Support Forum BSD Advocacy BSD Updates

Review Daemon: BSD Sockets Programming from a Multi-Language Perspective

Reviewed by Don Wilde, Silver Lynx, <Don@Silver-Lynx.com>


BSD Sockets Programming from a Multi-Language Perspective,

by M. Tim Jones, published by Charles River Media of Hingham, MA, 444 pages, $49.95

A new must-have for your programming library!


This is an impressive work. M. Tim Jones patiently builds up to his main subject matter with an easy-to-read progression that starts with the most basic networking concepts explained in detail. It's all so easy to read that even the most experienced programmer won't mind the thirty pages spent in reviewing the basics. The entire book is chock-full of diagrams and tables, averaging almost one per page.


Charles River Media is to be commended for the book's typesetting, style, and clarity of diagrams. I found the book to be very easy on my eyes, a joy to read. Notes and references abound, gently encouraging the reader to explore both source RFC's and earlier works such as W. Richard Stevens' “UNIX Network Programming.” The code listings are well presented, and I really liked the fact that they are complete, in keeping with the book's “multi-language perspective.” I didn't find any glaring typographical or grammatical errors anywhere in the text. The Table of Contents was very complete, and the included glossary of Acronyms was a very nice touch, but I did feel that the Index at the back was a little sparse.


Getting into the meat of the BSD Socket API, Mr. Jones treats each function lucidly and succinctly, giving the requisite libraries, the prototype, and a verbal description of each along with a clear diagram that expresses the concept visually. Flags and return values, where appropriate, are set off in gray highlight, greatly enhancing the book's value as a reference. All of the advanced socket functions are well covered, as well as the basics, and Mr. Jones does a great job describing the reasons and methodologies for optimizing the TCP/IP protocol itself for a given application. I found the 'Advanced Sockets Programming Topics' and 'Optimizing Sockets Applications' chapters to be particularly informative and well written, and the 'DEFENSIVE PROGRAMMING' section in the 'Sockets Programming Pitfalls' chapter is an absolute must-read.


The next section, on Network Programming, discusses the low-level usage of the Socket API functions in C, Java, Python, Perl, Ruby, and TCL. The section on each language begins with a simple diagram and short section discussing the language's historical roots and a description of the tools available on both open source UNIX®-like systems and Microsoft Windows® platforms, many of which are included on the CD-ROM. Socket programming in each language is well handled, and the parallel discussions of the various object syntax paradigms were very educational. Jones stays well away from language comparison flame bait, allowing each language to stand on its own. The language choices represent a wide range of current practice and paradigm, ranging from pure imperative compiled to object-oriented interpreters. While your favorite language might not be included, the book contains more than enough information to help you become a very competent socket programmer in any language and on any platform that supports BSD sockets.


The remaining chapters contain a very thorough treatment of basic client-server communication patterns. Mr. Jones starts with a language-independent treatment of the different basic protocol architectures for implementing point-to-point (stream), broadcast, and multicast systems, and then gives a concise explanation of the concepts involved in implementing two very common ASCII-based protocols, http and smtp. The remaining chapters detail the implementation of specific code in each target language for passing a string of data in each architecture and client and server code for each real-world protocol. Though they are what could be called “toy” applications, they are complete and functional and very educational.


Tim Jones has crafted his prose such that not a single word in the entire book is wasted. If anything, that leads to my few criticisms of the product. Some specifics that would have been useful, such as a table of mainstream processors which use Big-Endian vs. Little-Endian byte ordering, weren't there. A larger black hole, from my perspective, was that Jones did not discuss operating system platforms at all, either from a historical development perspective or current usage. It seems to me that this would have been very appropriate, given the level of detail he gives his language treatments and basic networking concepts. Even though the title says the topic is BSD Sockets, there was no mention at all of current BSD implementations anywhere in the text, nor in the System Requirements section detailing usage of the code on the CD-ROM. There was also no mention of kernel parameter tuning, which can dramatically affect the performance of real-world socket applications. I also would consider discussions of data packetizing and verification, and basic encryption and security concepts, as appropriate topics that would have enhanced the value of this book for a professional systems programmer.


All of the language platforms he mentions are kept current in the FreeBSD Ports Collection, including new FreeBSD-native Java development and runtime environments, and I had no trouble compiling or loading any of his example code on my FreeBSD 4.8-RELEASE and 4.X-STABLE systems. In all cases, the CD-ROM-based source code was current or near-current. To his credit, Mr. Jones includes source code tarballs for each language (except C) and license terms documentation, rather than Red Hat-specific RPM packages, making it easy to use the supplied code on any UNIX®-like platform. Several Windows®-based executables are also included, for Ruby and Python. In all cases, pointers to the master Internet source repository websites are included in the text.


These limitations notwithstanding, this book will serve very well as an intermediate text and reference for systems and application programmers. It does overlap W. Richard Stevens' two masterworks, but the wealth of new material detailing the syntax and paradigms of specific language implementations is very educational for both the student and the professional applications developer. I certainly learned a lot from its presentation of languages that I have not personally used! With the exception of his aforementioned blindness to platforms other than Microsoft Windows® and Linux, Mr. Jones does a very good job of explaining his subject in a clear and unbiased way. While the included code examples do not present any major real-world projects, other current and forthcoming Charles River titles target specific application environments and their real world constraints. All in all, this book deserves a place on any serious programmer's bookshelf.


Google
Web daemonnews.org

More Articles
  • Interview with Jan Schaumann
  • Interview with Theo de Raadt
  • Book Review: Virtualization with VMware ESX Server
  • Editorial: Not Quite Dead Yet
  • The Design of OpenBGPd
  • Interview with der Mouse
  • Letter to Steve Jobs
  • Interview with Manuel Bouyer on Xen
  • Apple and Open Source
  • BSDCan 2006
  • BSD Certification Survey Results
  • Lab in a Box
  • Ike Notes on BSDCan 2005
  • BSDCan 2005 Photos
  • FreeBSD Developer Summit Pictures

  • Advertisements




    Author maintains all copyrights on this article.
    Images and layout Copyright © 1998-2006 Dæmon News. All Rights Reserved.