UnixSocketAddress

Support for UNIX-domain (also known as local) sockets.

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 G_IO_ERROR_NOT_SUPPORTED errors. You can use UnixSocketAddress.abstractNamesSupported to see if abstract names are supported.

Note that <gio/gunixsocketaddress.h> belongs to the UNIX-specific GIO interfaces, thus you have to use the gio-unix-2.0.pc pkg-config file when using it.

Constructors

this
this(GUnixSocketAddress* gUnixSocketAddress, bool ownedRef)

Sets our main struct and passes it to the parent class.

this
this(string path)

Creates a new gio.UnixSocketAddress for path.

this
this(string path, GUnixSocketAddressType type)

Creates a new gio.UnixSocketAddress of type type with name path.

Members

Functions

getAddressType
GUnixSocketAddressType getAddressType()

Gets address's type.

getIsAbstract
bool getIsAbstract()

Tests if address is abstract.

getPath
string getPath()

Gets address's path, or for abstract sockets the "name".

getPathLen
size_t getPathLen()

Gets the length of address's path.

getStruct
void* getStruct()

the main Gtk struct as a void*

getUnixSocketAddressStruct
GUnixSocketAddress* getUnixSocketAddressStruct(bool transferOwnership)

Get the main Gtk struct

Static functions

abstractNamesSupported
bool abstractNamesSupported()

Checks if abstract UNIX domain socket names are supported.

getType
GType getType()

Variables

gUnixSocketAddress
GUnixSocketAddress* gUnixSocketAddress;

the main Gtk struct

Inherited Members

From SocketAddress

gSocketAddress
GSocketAddress* gSocketAddress;

the main Gtk struct

getSocketAddressStruct
GSocketAddress* getSocketAddressStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

getType
GType getType()
getFamily
GSocketFamily getFamily()

Gets the socket family type of address.

getNativeSize
ptrdiff_t getNativeSize()

Gets the size of address's native struct sockaddr. You can use this to allocate memory to pass to Socket.addressToNative.

toNative
bool toNative(void* dest, size_t destlen)

Converts a gio.SocketAddress to a native struct sockaddr, which can be passed to low-level functions like connect() or bind().