Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[network] Unix socket #112

Closed
codehz opened this issue Dec 15, 2019 · 2 comments
Closed

[network] Unix socket #112

codehz opened this issue Dec 15, 2019 · 2 comments

Comments

@codehz
Copy link
Contributor

codehz commented Dec 15, 2019

你在什么场景下需要该功能?

linux/win/macosx均有支持Unix socket(windows部分仅限win10,不过可以作为可选功能提供),可以认为这个特性已经跨平台了
为什么这个特性如此重要:
很多API如docker都是通过unix socket进行交互,相比pipe和fifo,它可以实现多客户端支持,相比传统loopback TCP/UDP socket方案,该方案无需占用宝贵的端口资源(很多时候你需要为RPC服务找端口,而有了unix socket这种file based的方案后,就不需要使用数字端口号了)

描述可能的解决方案

提供family = unix和unix地址的设置方案

描述你认为的候选方案

加入 unix.c unix.h 修改 socket.c 和 platform 部分,可能需要实现特性开关

其他信息

https://blogs.msdn.microsoft.com/commandline/2017/12/19/af_unix-comes-to-windows/

@codehz
Copy link
Contributor Author

codehz commented Dec 15, 2019

(正在打算发PR,先实现一个基础功能)

@waruqi
Copy link
Member

waruqi commented Dec 15, 2019

这个可以考虑支持上,如果要扩展,可以在ipaddr里面,扩展family 然后 union u 里面加个 unix struct

@waruqi waruqi added this to the v1.6.5 milestone Dec 16, 2019
waruqi added a commit that referenced this issue Dec 17, 2019
@waruqi waruqi closed this as completed Feb 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants