What source code is worth studying?
statictype: I learned about sockets and networking by looking at the source for wget.That's also where I saw calloc.c - A portable implementation of calloc. I distinctly remember it being one of the cleverest hacks I've seen.