TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Beej's Guide to Network Programming

518 pointsby mutant_glofishabout 2 years ago

25 comments

vajrabumabout 2 years ago
All Beej&#x27;s guides are fantastic, but if you&#x27;re interested in Network programming you could do way worse than follow this up with his guide to network concepts. <a href="https:&#x2F;&#x2F;beej.us&#x2F;guide&#x2F;bgnet0&#x2F;" rel="nofollow">https:&#x2F;&#x2F;beej.us&#x2F;guide&#x2F;bgnet0&#x2F;</a><p>If you search Algolia for Beej you&#x27;ll see his material has been on hacker news numerous times.
评论 #36028949 未加载
评论 #36033602 未加载
评论 #36029217 未加载
评论 #36028157 未加载
keyleabout 2 years ago
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:&#x2F;&#x2F;beej.us&#x2F;guide&#x2F;bgc&#x2F;html&#x2F;split&#x2F;" rel="nofollow">https:&#x2F;&#x2F;beej.us&#x2F;guide&#x2F;bgc&#x2F;html&#x2F;split&#x2F;</a>
评论 #36026953 未加载
评论 #36033532 未加载
评论 #36028237 未加载
ftxbroabout 2 years ago
&gt; &quot;The way I see it, it&#x27;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&#x27;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&#x27;s $480 million in extra revenue. From one good instructor.&quot;<p>OK but providing value isn&#x27;t the same as having power. It&#x27;s almost the opposite thing.
评论 #36027021 未加载
评论 #36028263 未加载
评论 #36026473 未加载
dangabout 2 years ago
Related (note: reposts are fine after a year or so - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;newsfaq.html" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;newsfaq.html</a>):<p><i>Beej&#x27;s Guide to Network Programming (1994-2020)</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=26100075" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=26100075</a> - Feb 2021 (165 comments)<p><i>Beej&#x27;s Guide to Network Programming</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=13983212" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=13983212</a> - March 2017 (44 comments)<p><i>Beej&#x27;s Guide to Network Programming</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=13670971" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=13670971</a> - Feb 2017 (6 comments)<p><i>Beej&#x27;s Guide to Network Programming</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=12402313" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=12402313</a> - Aug 2016 (4 comments)<p><i>Beej&#x27;s Guide to Network Programming (2012)</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=9445692" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=9445692</a> - April 2015 (31 comments)<p><i>Beej&#x27;s Guide to Network Programming</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=7584974" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=7584974</a> - April 2014 (1 comment)<p><i>Beej&#x27;s Guide to Network Programming</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=5241220" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=5241220</a> - Feb 2013 (47 comments)<p><i>Beej&#x27;s Guide to Network Programming</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=584557" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=584557</a> - April 2009 (22 comments)<p><i>Guide to Network Programming</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=337371" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=337371</a> - Oct 2008 (7 comments)
peter_l_downsabout 2 years ago
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&#x27;ve ever used, and it got me through my first real programming job. Wonderful text. Thank you, Beej!
评论 #36026468 未加载
b33j0rabout 2 years ago
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.
评论 #36026430 未加载
评论 #36026416 未加载
alberthabout 2 years ago
Beyond this being a fantastic document, I really appreciate it being offered as a single HTML page:<p><a href="https:&#x2F;&#x2F;beej.us&#x2F;guide&#x2F;bgnet&#x2F;html&#x2F;" rel="nofollow">https:&#x2F;&#x2F;beej.us&#x2F;guide&#x2F;bgnet&#x2F;html&#x2F;</a>
评论 #36026279 未加载
评论 #36026194 未加载
kqrabout 2 years ago
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&#x27;t need to deal with it; or<p>2. A library probably exists to abstract over the bytes-into-sockets layer, but I&#x27;ve chosen to ignore it either because I&#x27;m truly ignorant of it, or for intellectual stimulation.<p>(Note that in category 2 I count things like &quot;not using protobuf&#x2F;thrift&#x2F;etc. for IPC.)<p>When are these things not true? Genuinely curious! I&#x27;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?
评论 #36028040 未加载
评论 #36028135 未加载
评论 #36028479 未加载
评论 #36027884 未加载
评论 #36029756 未加载
评论 #36028304 未加载
评论 #36027977 未加载
评论 #36027965 未加载
评论 #36032229 未加载
Dowwieabout 2 years ago
I&#x27;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&#x27;t had the opportunity to otherwise. The &quot;Unusual Database&quot; 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&#x27;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&#x27;s possible to write robust servers without venturing much into low level network programming. Beej explains the lowest level details well. I&#x27;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
评论 #36031178 未加载
TallGuyShortabout 2 years ago
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.
verandaguyabout 2 years ago
This gets reposted on HN every few months or so,<p>And I couldn&#x27;t be happier, Beej&#x27;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.
thrwawy74about 2 years ago
I&#x27;m not saying Rust is the answer to all things, I&#x27;m saying I want a Rust translation for continuity of the wisdom and concision I loved in this guide as a 14 year old.
评论 #36027544 未加载
sabootabout 2 years ago
I&#x27;ll ask here in case I can get help.<p>I followed Beej&#x27;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&#x27;s an obvious &quot;oh did you set X?&quot; tip from someone that has done a similar task.
评论 #36027663 未加载
评论 #36027290 未加载
p4bl0about 2 years ago
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&#x27;t have IPv6 taken into account! Very nice to know that it is now the case! Thanks for posting :).
caust1cabout 2 years ago
Beej&#x27;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&#x27;s great to have had that experience at a state school.
coyotespikeabout 2 years ago
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.
jackphilsonabout 2 years ago
If you&#x27;re trying to learn networking, better to start off with the foundational knowledge rather than jump straight into the code. Right now I&#x27;m going through the networking section on <a href="https:&#x2F;&#x2F;teachyourselfcs.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;teachyourselfcs.com&#x2F;</a> which is pretty good so far.
评论 #36028374 未加载
d1n037about 2 years ago
Funny I was just going over this again yesterday. Also didn&#x27;t know he had one called Beej&#x27;s Guide to Network Concepts[0], which has some really good explanations in it.<p>[0] <a href="https:&#x2F;&#x2F;beej.us&#x2F;guide&#x2F;bgnet0&#x2F;html&#x2F;split&#x2F;" rel="nofollow">https:&#x2F;&#x2F;beej.us&#x2F;guide&#x2F;bgnet0&#x2F;html&#x2F;split&#x2F;</a>
ghoshbishakhabout 2 years ago
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:&#x2F;&#x2F;cse.iitkgp.ac.in&#x2F;~abhij&#x2F;" rel="nofollow">https:&#x2F;&#x2F;cse.iitkgp.ac.in&#x2F;~abhij&#x2F;</a>
snarkypixelabout 2 years ago
This guide was my bible when I was a kid. I learned not just network programming, but also C with it.
评论 #36026499 未加载
code_witch_samabout 2 years ago
learned sockets with this like 20 years ago programming IRC fserve bots in C
nickelproabout 2 years ago
This guide taught me how to program. I owe my entire career to beej
davidwabout 2 years ago
Pre-pandemic, beej used to come to programmer&#x2F;hacker events here in Bend. Haven&#x27;t seen him in a while though.
kderbymaalmost 2 years ago
Beej helped me get into programming back in 2004-5....what a legend!
zabzonkabout 2 years ago
it is what a great short guide should be. but i am sure dang will be posting a huge number of previous links.