<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>TCP on Timmoc 的技术小屋</title>
    <link>https://t1mmoc.github.io/tags/tcp/</link>
    <description>Recent content in TCP on Timmoc 的技术小屋</description>
    <generator>Hugo</generator>
    <language>zh-cn</language>
    <lastBuildDate>Sat, 17 Oct 2026 17:12:00 +0800</lastBuildDate>
    <atom:link href="https://t1mmoc.github.io/tags/tcp/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>【AIGC】自己定一个 TCP 帧协议：魔数、长度前缀、粘包，和一个把我救回来的全局开关</title>
      <link>https://t1mmoc.github.io/posts/2026-10-17-tcp-frame-protocol/</link>
      <pubDate>Sat, 17 Oct 2026 17:12:00 +0800</pubDate>
      <guid>https://t1mmoc.github.io/posts/2026-10-17-tcp-frame-protocol/</guid>
      <description>2023 年写了个 C/S 的东西，服务端 Java &#43; Apache MINA，客户端 C&#43;&#43; DLL，嫌 HTTP 不合适就自己定了协议：4 字节魔数 &#43; 4 字节长度 &#43; JSON 正文。事后看协议部分才是真正学到东西的地方——TCP 是字节流不是消息流，所以解码器必须变成状态机；状态不能放字段（MINA 的 decoder 是单例），我用了静态 HashMap 代价是泄漏和并发；length 字段在编码侧是字节数、在对象构造里是字符数，ASCII 下看不出来、中文差三倍；还有一个为了让某个会话别卡住而加的 static 全局开关，它会误伤所有会话。</description>
    </item>
    <item>
      <title>【AIGC】两个 2 KB 的「端口映射」工程：一个空壳，以及它教会我的两件事</title>
      <link>https://t1mmoc.github.io/posts/2026-10-17-epl-port-mapper/</link>
      <pubDate>Sat, 17 Oct 2026 12:13:00 +0800</pubDate>
      <guid>https://t1mmoc.github.io/posts/2026-10-17-epl-port-mapper/</guid>
      <description>端口映射测试/ 里是两个 1.7 KB 和 2.1 KB 的 .e，是研究易语言容器格式最好的标本——小到一个窗口就装得下全部结论（长度前缀、窗体记录形状、支持库表项的结构就是这么定下来的）。但扫完之后我必须推翻自己写在仓库 README 里的话：我原本说它是「一个最小可用的 TCP 中继」，实际上两个工程里 `数据到达` 出现 0 次、`连接`/`发送`/`监听` 也全是 0，唯一的事件处理函数只有 __启动窗口_创建完毕。它是一个停在「控件摆好了、事件挂上了」阶段的空壳。这一篇讲怎么拿最小的样本定格式，以及怎么用零命中来证伪自己编的故事。</description>
    </item>
  </channel>
</rss>
