sharplispers / clx

a fork of crhodes' fork of danb's fork of the CLX library, an X11 client for Common Lisp
Other
116 stars 46 forks source link

Should clx try to open an abstract socket? #163

Open scymtym opened 4 years ago

scymtym commented 4 years ago

This conversation as well as this one suggests that it is sometimes not possible to establish a connection to the "ordinary" UNIX socket at e.g. /tmp/.X11-unix/X0 or wherever the X server listens.

In the above cases, it turned out that the socket name wasn't wrong, but that the socket was of the abstract type, not the pathname type.

Maybe clx should try opening the socket using the pathname type and fall back to trying the abstract type. For SBCL, this translates to (make-instance 'sb-bsd-sockets:local-socket) and (make-instance 'sb-bsd-sockets:local-abstract-socket) respectively. I'm sure other implementations support this as well (if nothing else, it should be possible to stick a #\0 into the path as described in the man-page).