Linux supports a special addressing scheme for Unix domain sockets,
"abstract path", that avoids polluting the file system with
unnecessary entries.
I was wondering how to do that in Go and discovered that I had to
prefix the path name by "@" (digging through old issues and source
code).
Is that a well-spread convention? unix(7) manpage only says "the
address must begin with a NUL byte" but /proc/net/unix shows "@"
instead of the NUL byte.
I was wondering if the feature needed documentation or if users should
be able to guess by themselves.
package main
import (
"net"
"time"
)
func client() {
net.Dial("unix", "@/tmp/secret")
time.Sleep(time.Hour)
}
func main() {
go client()
c, _ := net.Listen("unix", "@/tmp/secret")
c.Accept()
time.Sleep(time.Hour)
}
Linux supports a special addressing scheme for Unix domain sockets,
"abstract path", that avoids polluting the file system with
unnecessary entries.
I was wondering how to do that in Go and discovered that I had to
prefix the path name by "@" (digging through old issues and source
code).Is that a well-spread convention? unix(7) manpage only says "the
address must begin with a NUL byte" but /proc/net/unix shows "@"
instead of the NUL byte.
I was wondering if the feature needed documentation or if users should
be able to guess by themselves.