It derives from <GSocketAddress>.
Support for UNIX-domain (also known as local) sockets, corresponding to
struct sockaddr_un.
UNIX domain sockets are generally visible in the filesystem. However,
some systems support abstract socket names which are not visible in the
filesystem and not affected by the filesystem permissions, visibility,
etc. Currently this is only supported under Linux. If you attempt to
use abstract sockets on other systems, function calls may return
not-supported errors. You can use
unix-socket-address:abstract-names-supported?
to see if abstract names are supported.
Since GLib 2.72, <GUnixSocketAddress> is
available on all platforms. It requires underlying system support (such
as Windows 10 with AF_UNIX) at run time.
Before GLib 2.72, <gio/gunixsocketaddress.h> belonged to the
UNIX-specific GIO interfaces, thus you had to use the
gio-unix-2.0.pc pkg-config file when using it. This is no longer
necessary since GLib 2.72.
parent-instanceWhether or not this is an abstract address
Its value is a boolean.
It can only be set when the object is made, with #:abstract.
The type of Unix socket address.
Its value is a
<GUnixSocketAddressType> (or, to set
it, one of its symbols).
It can only be set when the object is made, with #:address-type.
Unix socket path.
Its value is a string, or #f.
It can only be set when the object is made, with #:path.
Unix socket path, as a byte array.
Its value is a <GByteArray>, or #f.
It can only be set when the object is made, with #:path-as-array.
Checks if abstract UNIX domain socket names are supported.
Returned: a boolean.
#t if supported, #f otherwise
Gets self’s type.
Passed: a <GUnixSocketAddress>.
Returned: a
<GUnixSocketAddressType>.
Tests if self is abstract.
Passed: a <GUnixSocketAddress>.
Returned: a boolean.
#t if the address is abstract, #f otherwise
Gets self’s path, or for abstract sockets the "name".
Guaranteed to be zero-terminated, but an abstract socket may contain
embedded zeros, and thus you should use unix-socket-address:get-path-len to get the true length
of this string.
Passed: a <GUnixSocketAddress>.
Returned: a string.
the path for self
Gets the length of self’s path.
For details, see unix-socket-address:get-path.
Passed: a <GUnixSocketAddress>.
Returned: an unsigned 64-bit integer.
the length of the path
Creates a new <GUnixSocketAddress> for
path.
To create abstract socket addresses, on systems that support that, use
unix-socket-address:new-abstract.
Passed: a string.
the socket path
Returned: a <GSocketAddress>.
a new <GUnixSocketAddress>
Creates a new abstract-padded
<GUnixSocketAddress> for path.
Passed: a s8vector, or a list or vector, each an 8-bit integer.
the abstract name
Returned: a <GSocketAddress>.
a new <GUnixSocketAddress>
Not passed: guile-gi gives the length of path.
the length of path, or -1
Creates a new <GUnixSocketAddress> of
type type with name path.
If type is path, this is
equivalent to calling unix-socket-address:new.
If type is anonymous,
path and path-len will be ignored.
If path-type is abstract, then
path-len bytes of path will be copied to the socket’s path,
and only those bytes will be considered part of the name. (If
path-len is -1, then path is assumed to be NUL-terminated.)
For example, if path was "test", then calling
socket-address:get-native-size on the returned socket
would return 7 (2 bytes of overhead, 1 byte for the abstract-socket
indicator byte, and 4 bytes for the name "test").
If path-type is
abstract-padded, then path-len
bytes of path will be copied to the socket’s path, the rest of the
path will be padded with 0 bytes, and the entire zero-padded buffer will
be considered the name. (As above, if path-len is -1, then
path is assumed to be NUL-terminated.) In this case,
socket-address:get-native-size will always return the
full size of a struct sockaddr_un, although
unix-socket-address:get-path-len will still return just
the length of path.
abstract is preferred over
abstract-padded for new programs. Of
course, when connecting to a server created by another process, you must
use the appropriate type corresponding to how that process created its
listening socket.
Passed: a s8vector, or a list or vector, each an 8-bit integer.
the name
Passed: a <GUnixSocketAddressType>,
or one of its symbols.
Returned: a <GSocketAddress>.
a new <GUnixSocketAddress>
Not passed: guile-gi gives the length of path.
the length of path, or -1