tags:

views:

2821

answers:

8

I'm fairly new to C++ sockets.

Is there a book for beginners for C++ socket programming? for windows i really need help ive been through alot of tutorials dont get any of it and im using dev-C++

+6  A: 

Boost.Asio is a very good library for c++ socket programming.

Have a look at the provided examples in the documentation !

Benoît
+1 to that. I was about to suggest the same :)
Diego Sevilla
Hello. I have been doing some socket programming compiling with gcc and running on RedHat Linux. I have been programming udp/tcp. As I do everything in C. Can I still use the boost libraries if they are in C++?
robUK
If you are not willing to program (at least a bit) in C++, then no, you can't use boost libraries (with the exception of boost.preprocessor). Sorry.
Benoît
+7  A: 

Beej's guide to network programming is a great resource for learning socket programming.

Frostbytes.com also has a great tutorial on socket programming.

If you want something more in depth, check out Unix Network Programming by W. Richard Stevens.

Brian R. Bondy
I wholeheartedly agree. I was going to post this answer, but apparently my bookmark went stale... thank you for giving me the new URL.
rmeador
+4  A: 

The classic sockets book is Unix Network Programming by Stevens, Fenner, and Rudoff. This book is aimed at using sockets w/ C, as opposed to C++. It is a great reference book, and I've used it many times as a reference over the years.

Are you on Windows, and thus would want a WinSock book? There are also several Winsock books out there, although I don't have specific experience with them.

Steve Wranovsky
+1  A: 

The Boost Socket library will give you all you need. If size is less of a concern then Qt has an awesome event driven socket interface that you can override to speak more than network sockets. Both are pretty portable to Windows and Unix-type platforms.

Also, what platform are you on? Windows, Mac or some other Unix? Windows had a socket interface in MFC the last time I looked (long time ago). I just found this for .NET.

On a Unixy platform (and Windows if you don't want to use the native interfaces) you can use Berkley sockets from C++ by simply wrapping them up in a nice class layer; here is a starting point for that.

Adam Hawes
+1  A: 

It's not specifically aimed at beginners but it is THE book for Windows network programming: Network Programming for Microsoft Windows.

Len Holgate
+1  A: 

"C++ Network Programming" volumes 1 and 2 may be of use, as well. They are oriented toward the ACE C++ library, but the concepts should be useful even if you don't use ACE.

Void
A: 

There is classic Internetworking with TCP/IP: Principles, Protocols, and Architectures by Comer and others, which consists of 3 volumes. Volume 3 has several editions, one of them is Client-Server Programming and Applications, Windows Socket Version

dmityugov
A: 

Perhaps you are interested in learning more about the fundamentals of data communication networks. Check out these (free) MIT OpenCourseWare courses: Data Communication Networks; Computer Networks. Skim through the lecture notes. I'm sure it's much more than you need, but you might like it. :-)

Raj