Hands-On Network Programming with C: Learn socket programming in C and write secure and optimized network code
M**S
Exactly what you need for network programming in C
This book had exactly the info I needed to add networking capabilities to my program. I thought the book progressed in a very easy to follow way, and I think it does a good job of balancing theory with practice.I also really like all of the example programs. They're all on Github, and they're just complete enough to be very practical, but not so big as to have any extra fluff. Most books either have examples that are too "toy" to be useful, or that include a bunch of extra functions irrelevant to the subject matter. This book strikes the perfect balance!If you told me last year that I'd be able to program a complete and functional HTTPS server in C after reading only one book on the subject, I'd think you were crazy. But here it is!PS despite the other reviews, I didn't notice any errors in the book or with the example programs.
S**S
Great Example Programs
I was tasked with adding some simple network functionality to a legacy program. It only needed to hit a simple online API and read a one-word response. Seems easy, right? I know there are a lot of free libraries to do this, so I tried several of them first. I either couldn't get them to work properly, or they messed up our (admittedly over-complicated) build system.Anyway, I had my work buy three books on the topic, figuring I'd implement the needed functionality from scratch. This is the only book I ended up using, and I basically just copied the example program. The examples are licensed MIT, so we're allowed to use them. I got it working perfectly within a few hours. It's all pure C/C++ code, so it works fine with our weird build system. It compiles on all of our platforms, plays nice with IPv6, ad doesn't cause any problems.I don't imagine there are too many people needing C/C++ networking code in 2019, but if you're such a person, this is perhaps the only good modern book on the topic.
C**R
Extremely excellent book.
This is probably the most rewarding book I have read related to programming. I also read TCP/IP sockets in C. That book was very good. This book is 10 times better than that book. It really is that good. The knowledge is totally empowering. All the programming examples work great and are a good study in c programming in itself not to mention network programming. You have to read it to see what I'm talking about here. It's too hard to describe why this book is so good. If you want to be able to network your programs or create clients and servers and understand network security this is your book. I would recommend reading a book on C programming first, not that the examples are all that complicated, but just to be sure you are not missing all the great knowledge here. I read, C programming A modern approach to get familiar with C programming, personally.
P**T
Learn how not to program sockets.
I started and progressed through the first couple of chapters. I would normally not give this book one star, as the authors knowledge is limited in the field of socket programming. Example: The very first program should find the connected network devices. Devices live on the OSI Model Level 2. The program indicates that we are looking for IPv4 or IPv6 which live on the OSI model Layer 3. As a result leaving the novice reader wondering why the program is not responding as expected. So after a short debugging I found the return value, and found it was a layer 2 responses vs the Networking layer (layer 3) that’s when it dawned on me, the networking device lives on the device layer , and after one Google search I was able to confirm the obvious. This tells me one thing for certain, the author does not know the subject matter as well as the book attempts to lead on. It wouldn’t be so tragic if it were a small mistake like a missing pointer or an int versus a long, the compiler catches that but looking at an entirely different part of the computer? Update: As a dev I know bugs sometimes make it through to production. As I continued reading there is extremely valuable information and guidance...
D**R
A good overview of network programming
If I could describe this book in a word, it would be ambitious. Where most guides I've seen on this topic stick to POSIX implementations, this book goes fully cross platform, including even Windows. Other guides might focus on the nuances of constructing network sockets by hand and manually entering an IPv4 addresses into some struct, but this one chooses to immediately target IPv4 and IPv6. It spends an entire chapter on DNS, where other guides might handwave this away as something you'll figure out another time. With this in mind, I feel this book succeeds at being a good overview of web technologies, which will get you up and running and let you know what to look into more.Like a lot of other programming books, many chapters in this book follow a format of showing a single example program, spread into bite sized chunks of code with paragraphs of prose explaining what's going on. While I was a little disappointed by the lack of exercises (there are a few, but they aren't extensive), the examples are effective, easy to follow and clearly explained. I'm not much of a literary critic, and I can't speak to the quality of the writing itself in an articulate way, but I would describe the prose as serviceable. The author's voice isn't entirely consistent throughout, although it's hard for me to put my finger on why exactly I feel that way. You occasionally run across choppy or awkward sentence structures, which are never indecipherable but can be distracting, but feel like a tighter edit would have caught. I wouldn't say this got in the way of conveying ideas, and I didn't really find it an issue, just that it wasn't quite as seamless as some other texts.The decision to cover so many topics in such a broad way is both a positive and a negative. I was surprised by how flexible the POSIX and C libraries were, which this book does a much better job of establishing than certain other guides. However, in order to maintain cross-platform performance, almost every chapter begins with a header defining a series of macros, many of which simply map to system calls. While something of this nature may be fine on a medium scale project, I do think something is lost by using these macros when working through examples, even if the core concepts remain the same. I was going to say in this review that building cross platform doesn't feel necessary (if we can at least target POSIX-like, it'd be fine), except that several of my computers were physically stolen when I was halfway through the book, and it was indeed remarkably convenient to transfer all the code examples onto a windows box I borrowed and have them all run without modification.Due to the sheer volume being covered, you will need to spend some time in the man pages to really get what's being covered. While it's not too egregious, there are occasions where functions are used which will not be introduced for several more chapters. Additionally, I enjoy getting clearly formatted charts showing the composition of data structures that are introduced (addr_in or others), which are sometimes present but not always. Again, these are basically all in the man pages so it's not too big a deal.Though I have been focusing negatives until now, you should keep in mind that this book will indeed get you a TCP client up and running by chapter 3, and a simple HTTP server by chapter 7. "Hands-On Network Programming in C" is a very apt title, although if I were naming it, I'd throw a "practical" in there somewhere. It has around the same level of depth as the first few chapters of K & R. It's not the be all and end all, but it'll get you running and let you know what you should look into more. What's more remarkable is that it gets you so far in such a short amount of text.Overall, I am satisfied with this book. It helped get me where I needed to be in terms of understanding this technology, although I did have to supplement portions of it with man pages and online materials (shoutouts to Beej), which should be expected from any introductory book to such a broad topic. If you want to learn to program sockets and write your own HTTP servers in C, this is not a bad way to start at all.
Trustpilot
5 days ago
1 month ago