Skip to content

Recommended Book: Unix Network Programming, Third Edition

Over the years I’ve tinkered directly with the Sockets API on Windows via WinSock, but never have I touched it on a Posix platform. I’ve also written client/server apps from a higher level, through Java and Python. Most of the information for it all I picked up on the net, though I do own a book covering WinSock and a couple on Java networking. While those are okay, they are nothing compared to the tome of knowledge that is Unix Network Programming.

The third edition of the classic, originally written by the late W. Richard Stevens, has been updated by Bill Fenner and Andrew M. Rudoff to bring the book up to speed with the current state of network programming. I’ve known about the book for years, but living in a Windows world I never bothered with it. I recently purchased it because I’m currently working on a project that requires me to get up close and personal with sockets on Posix platforms. Anyone who knows me, or has read my other blogs or forum posts, knows I am not a fan of Linux at all. But I need to get up to speed with it (and FreeBSD), so I recently installed Ubuntu (not the first time) and so far all is well. Now, I’m wishing I had gotten the book, and others by Stevens, years ago.

If you are like me, you’re a semi-competent network programmer. You don’t know the ins and outs of the whole thing. You know how to create sockets for different protocols, implement a server and a client, and get them talking to each other. Or maybe you’re not like me. Maybe you don’t know squat about network programming, or at least not how to do it with sockets. Or maybe you are somewhat advanced, but still have a few holes in your knowledge. If you fall into any those categories (and that should cover a broad range of people) then there is most definitely something in this book for you.

In addition to covering the API calls you need to get a client/server up and running, there is quite a bit of detail about the IP, TCP, UDP, and SCTP protocols. There is coverage of Posix signals and how to handle them, how to implement an application that uses the fork() system call, details on the pthreads API, how to handle different error conditions, when specific errors are thrown and what they mean… the knowledge available in this book will not only bring you completely up to speed with network (and multi-threaded) programming on Posix system, much of it applies to other platforms as well. I’ve always been unsure how to handle certain exceptions when using Java NIO (the dearth of documentation on the subject is sad), but reading this book I now know a great deal more about which errors occur in which circumstances, what they mean, how to handle them, and how I can translate that to Java. Java isn’t mentioned at all in the book, but if you understand the core concepts you can see how they relate to other platforms and APIs you may be familiar with.

Being a novice at Posix programming of any kind, I’ve gotten a lot more out of this book than I had expected. It is easily the best purchase I have made in the last year. If you want to know about general details of network programming and pick up some Posix-specific info along the way, you need to have Unix Network Programming on your shelf. Volume 2 covers interprocess communication. I’ll be picking that up in due course.

A perfect companion is TCP/IP Illustrated Volume 1, also by Richard Stevens. It goes through the internals of several networking protocols, from the low level stuff (IP, TCP, UDP and more) to higher level protocols (HTTP, FTP, SMTP and so on). I don’t yet have the subsequent two volumes of that series, but you’ll certainly hear about it when I do.

Technorati Tags: , , , , , , , , , , , , ,

powered by performancing firefox

Post a Comment

Your email is never published nor shared. Required fields are marked *