Baike.dev
All toolsTrendingOpen sourceNewsSubmit
Log in
< 返回工具列表
F

fd

> 编程语言
开源

Pass Go file descriptors and connections between different OS processes.

44.3K stars0 点赞0 次浏览
访问官网GitHub

工具介绍

Pass Go file descriptors and connections between different OS processes.

fd

Package fd provides a simple API to pass file descriptors between different OS processes.

It can be useful if you want to inherit network connections from another process without closing them.

Example scenario:

  • Running server receives a "let's upgrade" message
  • Server opens a Unix domain socket for the "upgrade"
  • Server starts a new copy of itself and passes Unix domain socket name
  • New copy starts reading data from the socket
  • Server sends its state over the socket, also sending the number of network connections to inherit, then it sends those connections using fd.Put()
  • New server copy reads the state and inherits connections using fd.Get(), checks that everything is OK and writes an "OK" message to the socket
  • Server receives "OK" message and kills itself

Documentation

fd on godoc.org

核心特点

  • •Running server receives a "let's upgrade" message
  • •Server opens a Unix domain socket for the "upgrade"
  • •Server starts a new copy of itself and passes Unix domain
  • •New copy starts reading data from the socket
  • •Server sends its state over the socket, also sending the number
  • •New server copy reads the state and inherits connections using fd.Get(),
  • •Server receives "OK" message and kills itself

> 标签

Go

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月9日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言