SocketAddress

For functions that give you an unknown address, you can use this to hold it.

Can get: ip4 ip6 unix abstract_

name lookup for connect (stream or dgram) request canonical name?

interface lookup for bind (stream or dgram)

Members

Functions

toString
string toString()

Returns a string representation of the address that identifies it in a custom format.

Static functions

abstract_
SocketAddress abstract_(char[] path)

Returns a single address object for the given protocol and parameters.

allInterfaces
SocketAddress[] allInterfaces(ushort port, UserProvidedBuffer!SocketAddress buffer)
SocketAddress[] allInterfaces(char[] serviceOrPort, UserProvidedBuffer!SocketAddress buffer)

Provides the set of addresses to listen on all supported protocols on the machine for the given interfaces. localhost only listens on the loopback interface, whereas allInterfaces will listen on loopback as well as the others on the system (meaning it may be publicly exposed to the internet).

get
SocketAddress[] get(char[] nodeName, char[] serviceOrPort, addrinfo* hints, UserProvidedBuffer!SocketAddress buffer, bool delegate(scope addrinfo* ai) filter)

Calls getaddrinfo and returns the array of results. It will populate the data into the buffer you provide, if you provide one, otherwise it will allocate its own.

ip4
SocketAddress ip4(char[] address, ushort port, bool forListening)
SocketAddress ip4(ushort port)
ip6
SocketAddress ip6(char[] address, ushort port, bool forListening)
SocketAddress ip6(ushort port)

Returns a single address object for the given protocol and parameters.

localhost
SocketAddress[] localhost(ushort port, UserProvidedBuffer!SocketAddress buffer)

Provides the set of addresses to listen on all supported protocols on the machine for the given interfaces. localhost only listens on the loopback interface, whereas allInterfaces will listen on loopback as well as the others on the system (meaning it may be publicly exposed to the internet).

unix
SocketAddress unix(char[] path)

Returns a single address object for the given protocol and parameters.

Meta