On the other day searching on internet for TCP/IP Socket Codes i found a website with code examples of TCP and UDP Socket in several languages like C, Java, Perl and Python. That website was Techtalks.
So i leave here the link to the website and a video tutorial on "how to compile and test the TCP/IP Socket code in C language". I will also leave the direct link to download all the socket examples from Techtalks.
Download Socket Examples.