http://en.wikipedia.org/wiki/Internet_socket
http://en.wikipedia.org/wiki/Thread_(computer_science)

My recommendation would be to get the hang of threading and socket programming separately, and once you've got the hang of both individually, then combine the two.