TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Introduction to TCP and Sockets (2001)

261 点作者 unobatbayar将近 3 年前

6 条评论

dragontamer将近 3 年前
I feel like beginner programmers should experiment with the following concepts in order.<p>1. File I&#x2F;O to plaintext files. fread&#x2F;fwrite, or whatever equivalent is in your programming language (Python fd.read() or whatever) is your first step into I&#x2F;O. Especially because you can open the file and read it yourself as a human.<p>2. Piped I&#x2F;O using Unix Pipes and&#x2F;or Fifos. Pipes (.&#x2F;program1 | .&#x2F;program2) are by far the easiest interprocess communication mechanism. They&#x27;re not very flexible, but they&#x27;re obvious to understand once you have mastered simple File I&#x2F;O.<p>3. TCP Sockets are the natural evolution from pipes. Your first TCP Server will not be socket&#x2F;bind&#x2F;accept, since this is a bit complicated. Instead, you should write nc -l (port number) | .&#x2F;myprogram, where netcat does the heavy lifting for you and creates a listening server for .&#x2F;myprogram. You then have the ability to write .&#x2F;myclient (which communicates to netcat, and therefore to &quot;myprogram&quot;).<p>4. You finalize this by writing the server side without the netcat training wheels, to learn the socket&#x2F;bind&#x2F;accept dance.
评论 #32162207 未加载
评论 #32162544 未加载
评论 #32163106 未加载
29athrowaway将近 3 年前
Beej&#x27;s Guide to Network Programming Using Internet Sockets<p><a href="https:&#x2F;&#x2F;beej.us&#x2F;guide&#x2F;bgnet&#x2F;" rel="nofollow">https:&#x2F;&#x2F;beej.us&#x2F;guide&#x2F;bgnet&#x2F;</a>
评论 #32161522 未加载
评论 #32161280 未加载
评论 #32161139 未加载
danieleggert将近 3 年前
Wrote this some years ago:<p><a href="https:&#x2F;&#x2F;www.objc.io&#x2F;issues&#x2F;10-syncing-data&#x2F;ip-tcp-http&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.objc.io&#x2F;issues&#x2F;10-syncing-data&#x2F;ip-tcp-http&#x2F;</a>
Pr0ject217将近 3 年前
As a late-bloomer programmer who hasn&#x27;t yet found a &#x27;niche&#x27; to love, I have a genuine question for those who are passionate about network programming.<p>What attracts you to network programming?<p>Thank you.
评论 #32166941 未加载
togs将近 3 年前
NAT always confuses me. What do you mean I have two IP addresses why can’t this be simplified?
lurker53将近 3 年前
Such basic stuff, even first year students should know this...
评论 #32163537 未加载