md wrote:
Do a google for "Beej's Guide" and you should find the best guide to sockets you could ever want. Also, take a look at the cSocket class at
svn://svn.nxor.org/vnet/
Took the words right out of my mouth...er fingers...
If you prefer winsock, check the MSDN website for a breakdown of how it is used...(their example on MSDN uses EXTREMELY bad logic however, but at least it will run you through the order of steps.
When coded properly, the winsock is very quick and very solid, but alas it only works with windows. When making cross platform sockets there is a lot of #ifdef's to deal with and can make your code look pretty hideous at times.
Since you're just beginning sockets, I'd suggest starting with a single platform (window=winsock, *nix=*nix sockets) and basically get your bearing on both independantly from eachother at first. THEN combine them into a cross-platform library.
You will better understand the differences between the two, and despite what all the linux die-hards or the windows die-hards will say...it is still very important to know BOTH windows and linux platforms and their relative api's, no matter which you prefer using.