All Beej's guides are fantastic, but if you're interested in Network programming you could do way worse than follow this up with his guide to network concepts. <a href="https://beej.us/guide/bgnet0/" rel="nofollow">https://beej.us/guide/bgnet0/</a><p>If you search Algolia for Beej you'll see his material has been on hacker news numerous times.
There is also a C guide [1] which has a pretty interesting email policy...<p><pre><code> I’m generally available to help out with email questions so feel free to write in, but I can’t guarantee a response.
I lead a pretty busy life and there are times when I just can’t answer a question you have.
When that’s the case, I usually just delete the message. It’s nothing personal;
I just won’t ever have the time to give the detailed answer you require. [...]
</code></pre>
[1] <a href="https://beej.us/guide/bgc/html/split/" rel="nofollow">https://beej.us/guide/bgc/html/split/</a>
> "The way I see it, it's the educators who hold all the power in the world. No, stop laughing and hear me out. A good instructor can, over the course of their career, create hundreds of millions or even billions of dollars of GDP. Let's say a teacher teaches 40 students a year for 30 years. And Each of those students goes on to work for 40 years. And, due to the quality of instruction, they earn $10,000 more per year than they would have otherwise. That's $480 million in extra revenue. From one good instructor."<p>OK but providing value isn't the same as having power. It's almost the opposite thing.
Posted a million times before, and should be posted a million times again in the future. This is one of the only reference books I've ever used, and it got me through my first real programming job. Wonderful text. Thank you, Beej!
My nick has been Beej or b33j ever since starcraft or counterstrike 1.5.<p>I will always bring up “but you know who the real beej is, right?” if the other person is a nerd.
Beyond this being a fantastic document, I really appreciate it being offered as a single HTML page:<p><a href="https://beej.us/guide/bgnet/html/" rel="nofollow">https://beej.us/guide/bgnet/html/</a>
Open question: in what fields are you working where you <i>really</i> need to work with actual sockets? Most of the network programming I do fall into one of two categories:<p>1. A library exists to abstract over the bytes-into-sockets layer, meaning I don't need to deal with it; or<p>2. A library probably exists to abstract over the bytes-into-sockets layer, but I've chosen to ignore it either because I'm truly ignorant of it, or for intellectual stimulation.<p>(Note that in category 2 I count things like "not using protobuf/thrift/etc. for IPC.)<p>When are these things not true? Genuinely curious! I'm guessing interfacing with existing obscure third parties, or using obscure language environments, but what are examples of that? And what other usages are there?
I've been working on the Protohackers [1] exercises in Elixir, putting my own spin on the problems by creating fault tolerant, scalable, high performance solutions-- and have been touching a lot of Elixir that I haven't had the opportunity to otherwise. The "Unusual Database" problem, particularly, has become a very deep rabbit hole assignment as it involves a UDP-based KV database. I stopped just short of clustering.<p>Writing servers in Elixir is straightforward because of the foundation exposed by Erlang's gen_tcp and gen_udp libraries. When you want to take your TCP server up a notch, try TCP acceptor pooling. There are two viable TCP acceptor pool libraries: Thousand Island, written in pure Elixir, and Ranch, written in Erlang.<p>Because of these well- abstracted foundation libraries and acceptor pool libraries, it's possible to write robust servers without venturing much into low level network programming. Beej explains the lowest level details well. I've done some of the equivalent work in Rust but found the slow progress of my work unsatisfying and moved back to Elixir quickly.<p>[1] protohackers.com
There is a handful of people whose tabs I would instantly pick up were I to meet them somewhere because of the immense value I have gotten from their free work online, writing stuff, answering forum posts, etc.<p>Beej possibly tops that list.
This gets reposted on HN every few months or so,<p>And I couldn't be happier, Beej's guide is a seminal read for anyone looking to get into net programming. Exposing as many newbies to it as possible helps strengthen the field.
I'm not saying Rust is the answer to all things, I'm saying I want a Rust translation for continuity of the wisdom and concision I loved in this guide as a 14 year old.
I'll ask here in case I can get help.<p>I followed Beej's linked guide to transfer data over udp sometime ago, written in C on a Windows machine. I then compiled the code on Mac os x but could never get it to work properly. Tried all the Google suggestions at the time, posting this comment in case there's an obvious "oh did you set X?" tip from someone that has done a similar task.
I love this guide, I gave this link as a reference to my students when I was teaching networks a few years ago. But the last time I looked at it the guide didn't have IPv6 taken into account! Very nice to know that it is now the case! Thanks for posting :).
Beej's guides are fantastic. He went to Chico State and I was happy to learn that his books were used for teaching network programming there when I attended.<p>Genuinely inspirational hacker. Feel's great to have had that experience at a state school.
Beej wrote the first computer science curriculum for Lambda School, which accounts for its initial breadth and depth. I taught there so I could learn CS, spending many hours to learn each class before teaching it.<p>One of my favorite modules he designed was on computer architecture. We simulated the CPU and registers in Python (they switched from C right before I got there), and each class extended our instruction set.<p>Teaching his modules taught me enough that I was able to start the MSCS program at UT Austin.
If you're trying to learn networking, better to start off with the foundational knowledge rather than jump straight into the code. Right now I'm going through the networking section on <a href="https://teachyourselfcs.com/" rel="nofollow">https://teachyourselfcs.com/</a> which is pretty good so far.
Funny I was just going over this again yesterday. Also didn't know he had one called Beej's Guide to Network Concepts[0], which has some really good explanations in it.<p>[0] <a href="https://beej.us/guide/bgnet0/html/split/" rel="nofollow">https://beej.us/guide/bgnet0/html/split/</a>
This is a fantastic guide and this was used in our programming lab at IIT Kharagpur. The lab was headed by an equally awesome instructor - Abhijit Das [1]<p>[1] <a href="https://cse.iitkgp.ac.in/~abhij/" rel="nofollow">https://cse.iitkgp.ac.in/~abhij/</a>