Bash:连接到Linux抽象UNIX套接字

我有abstract Linux socket听取连接.

抽象的Linux套接字基本上是一个名为AF_UNIX的套接字 – 除了名称不引用文件系统上的文件.相反,名称只是位于内核中抽象套接字命名空间内的唯一名称.

我的问题:有没有办法只使用Bash shell连接到抽象套接字?我从this question开始就知道你可以使用socat或netcat连接到与文件系统上的文件相关联的普通命名的AF_UNIX套接字.但是当我尝试使用抽象套接字时,它不起作用(它将我的名字字符串视为文件,并报告“找不到文件”,这是我的预期.)

那么,我可以使用任何实用程序连接到抽象的Linux套接字吗?

解决方法:

现代版本的socat为此提供了一个ABSTRACT命名空间.

引自the manual

ABSTRACT-CONNECT:<string>

ABSTRACT-LISTEN:<string>

ABSTRACT-SENDTO:<string>

ABSTRACT-RECVFROM:<string>

ABSTRACT-RECV:<string>

ABSTRACT-CLIENT:<string>

The ABSTRACT addresses are almost identical to the related UNIX addresses except that they do not address file system based sockets but an alternate UNIX domain address space. To archieve this the socket address strings are prefixed with “\0” internally. This feature is available (only?) on Linux. Option groups are the same as with the related UNIX addresses, except that the ABSTRACT addresses are not member of the NAMED group.

相关文章

用的openwrt路由器,家里宽带申请了动态公网ip,为了方便把2...
#!/bin/bashcommand1&command2&wait从Shell脚本并行...
1.先查出MAMP下面集成的PHP版本cd/Applications/MAMP/bin/ph...
1、先输入locale-a,查看一下现在已安装的语言2、若不存在如...
BashPerlTclsyntaxdiff1.进制数表示Languagebinaryoctalhexa...
正常安装了k8s后,使用kubect工具后接的命令不能直接tab补全...