This is the book to learn TCP/IP, doesn't matter what language you will be using:
W. Richard Stevens, TCP/IP Illustrated, Volume 1: The Protocols
The following is the C network programmer's bible, highly recommended:
W. Richard Stevens, Unix Network Programming, Volume 1: The Sockets Networking API
Out of online resources, Beej's Guide to Network Programming tops the list.