I did update it for IPv6, but that was several years ago.
So I'm not sure which update the OP is referring to.
Appreciate the kind words, though!
When I was a kid, socket programming felt like a huge thing to me, like unlocking the next level of programming. "Imagine if I could get 2 separate computers to talk to each other!" But it felt impenetrable, and used lots of weird and confusing C tricks.
Your guide demystified the whole subject and put it in plain language that teenage me could understand, and with it, I was able to build my first network-based "hello world". It was a magical feeling to see those messages delivered across the network. Thanks Beej!
This was my story as well, I wonder how many people have been through this just like us!?
So interesting that so many people have the same experience
And yes, it worked in a real emergency ! the heli didn’t have any rotors afterwards but we still had our heads.
So I guess you maybe saved my life ?
Not directly related but while you're here: you should _really_ add Marcus Rediker's Villains of all nations to your Pirates reading list. I highly recommend it! It's the best pirates' book ever =).
I just happened to reread the guide a couple of weeks ago. I hadn't done c socket programming in maybe a few years, and the guide refreshed my memory really well.
I've used it a few times over the years.
Thanks a lot!
So in a way this ended up to be perfect clickbait. But nobody seems to complain because despite not having been updated the guide seems to recall many fond memories by the commenters.
Highlighting users does not work on HN, I think the recommendation is to send an email.
Summoning dang usually works, for some reason.
Thank you for your existence.
That’s all. Thank you!
Thank you!
1. https://docs.python.org/3/library/socket.html
2. https://ruby-doc.org/stdlib-2.5.3/libdoc/socket/rdoc/Socket....
Edit: This is a more up to date link. I don't think the library has changed since 2.5.3, but I usually try to look at latest documentation: https://ruby-doc.org/stdlib-3.1.2/libdoc/socket/rdoc/Socket....
That being said, this book teaches network programming from the ground up so I would recommend understanding how to compile and output C code, then go through the book.
If you run into keywords, or syntax that you are not familiar with, just google it, and then keep working through the examples.
Mind you, the key takeaways from this book are not how to network practice IN C, but general practices. This knowledge can be applied to plenty of other languages such as Rust.
The way I learned C is I printed out the Beej's guide client/server code and walked around staring at it until it made sense. (That and compiling/running it and looking up functions in the man pages.)
I also really like K&R2 and Van der Linden.
If you're looking for something up to date I'd recommend this:
In other words, you will know when you need it - unless you forget it exists (note: bookmarking it might be a good idea, cause you could remember something like this exists but "what was the name again?").
Actually, they're not, so this is weird. I can't repro, and ripgrep tells me "cnet" doesn't appear in my web pages anywhere.
If you find it, I'd love to know what it is.
Thank you, Beej. Looking forward to reading this again today.
1. https://omscs.gatech.edu/cs-6200-introduction-operating-syst...
I chuckled!
[0] https://pubs.opengroup.org/onlinepubs/009695399/functions/po...
this guide was what got me into programming years ago
and i still refer to it from time to time
Couldn't recommend this more. Free online, plus you can purchase the paperback now.
Thanks for your work Beej! I've referenced your pages many times over the years.