Actually, scratch the "UNIX Network Programming Volume 2" -- nice to have, but not as useful here as Volume 1.
If you can only buy one book, get that Volume 1.
But the "Advanced Programming in the UNIX Environment" book is almost essential for lots of stuff too.