Lots of errors newdarkness. I didn't bother to run it.
My proposal is to move up with your C++ skills without sockets first. For example you have to forward declare classes or structs before you can use them the way you do.
After practicing with C++ go to:
http://www.linuxgazette.com/issue74/tougher.html
For a decent intro.