UnixAddress

Encapsulates an address for a Unix domain socket (AF_UNIX), i.e. a socket bound to a path name in the file system. Available only on supported systems.

Linux also supports an abstract address namespace, in which addresses are independent of the file system. A socket address is abstract iff path starts with a _null byte ('\0'). Null bytes in other positions of an abstract address are allowed and have no special meaning.

Constructors

this
this(const(char)[] path)

Construct a new UnixAddress from the specified path.

this
this(sockaddr_un addr)

Construct a new UnixAddress.

Members

Functions

toString
string toString()

Get the underlying _path.

Properties

path
string path [@property getter]

Get the underlying path.

Inherited Members

From Address

name
sockaddr* name [@property getter]

Returns pointer to underlying sockaddr structure.

nameLen
socklen_t nameLen [@property getter]

Returns actual size of underlying sockaddr structure.

addressFamily
AddressFamily addressFamily [@property getter]

Family of this address.

toAddrString
string toAddrString()

Attempts to retrieve the host address as a human-readable string.

toHostNameString
string toHostNameString()

Attempts to retrieve the host name as a fully qualified domain name.

toPortString
string toPortString()

Attempts to retrieve the numeric port number as a string.

toServiceNameString
string toServiceNameString()

Attempts to retrieve the service name as a string.

toString
string toString()

Human readable string representing this address.

Examples

auto addr = new UnixAddress("/var/run/dbus/system_bus_socket");
auto abstractAddr = new UnixAddress("\0/tmp/dbus-OtHLWmCLPR");

See Also

Meta