If you want a book on network programming, there are a few classic choices. [Comer’s] TCP/IP books are a great reference but sometimes is too low level. “Unix Networking Programming” by [Stevens] is the usual choice, but it is getting a little long in the tooth, as well. Now we have “Beej’s Guide to Network Programming Using Internet Sockets.” While the title doesn’t exactly roll off the tongue, the content is right on and fresh. Best part? You can read it now in your browser or in PDF format.
All the topics you’d expect are there in ten chapters. Of course, there’s the obligatory description of what a socket is and the types of sockets you commonly encounter. Then there’s coverage of addressing and portability. There’s even a section on IPV6.
After covering the most common socket API calls, there is a simple example. Then Chapter 7 covers “slightly advanced techniques.” That includes things like the select API call, partial sends, and broadcast packets. Chapter 9 is just man pages which are handy if you have the printed reference on an airplane. Overall, a good modern treatment of the topic.
While the socket API originated at Berkely, just about every network stack looks the same more or less, so if you learn these calls, you’ll do fine on whatever operating system you like, including many microcontrollers.
Usually, when we are looking at networking, our eyes are focused lower in the stack. But if you aren’t reverse engineering, the API is definitely the way to go.
13 thoughts on “Network Programming”
Oh great. Yet another super interesting PDF I’ve now downloaded and put into my ever-growing stack of PDF’s I’ll get to real soon now! :-)
I keep telling myself that in regards to Al Williams Linux Fu articles.
IP sockets, in metric or imperial?
I can neither confirm nor deny what type they are, that is Intellectual Property.
But rest assured, the enclosures can be used in in wet environments.
Beej’s was my go-to for understanding the connection order some twenty years ago. I’m glad to hear that it’s still being updated.
send is easy
how send trought ssl/tsl https
I would highly recommend a book over learning RPC programming and IDL the way I did, man pages in HPUX circa 1989.
It’s good to know that the 7(4?)-layer model is alive and kicking.
Of course, nowadays we work within frameworks (Qt, anyone?) but it’s always good to know which OS (by which I mean Linux, of course!) calls are being utilised. Furthermore, you might use something like “QTcpSocket::connect() ” but it always pays to know what that is actually doing, and what a TCP socket actually is.
Please be kind and respectful to help make the comments section excellent. (Comment Policy)