InetSocketAddress

An IPv4 or IPv6 socket address. That is, the combination of a gio.inet_address.InetAddress and a port number.

In UNIX terms, gio.inet_socket_address.InetSocketAddress corresponds to a `struct sockaddr_in` or `struct sockaddr_in6`.

Constructors

this
this(gio.inet_address.InetAddress address, ushort port)

Creates a new #GInetSocketAddress for address and port.

Members

Functions

getAddress
gio.inet_address.InetAddress getAddress()

Gets address's #GInetAddress.

getFlowinfo
uint getFlowinfo()

Gets the sin6_flowinfo field from address, which must be an IPv6 address.

getPort
ushort getPort()

Gets address's port.

getScopeId
uint getScopeId()

Gets the sin6_scope_id field from address, which must be an IPv6 address.

Static functions

newFromString
gio.inet_socket_address.InetSocketAddress newFromString(string address, uint port)

Creates a new #GInetSocketAddress for address and port.

Inherited Members

From SocketAddress

newFromNative
gio.socket_address.SocketAddress newFromNative(void* native, size_t len)

Creates a #GSocketAddress subclass corresponding to the native struct sockaddr native.

getFamily
gio.types.SocketFamily 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 gio.socket_address.SocketAddress.toNative.

toNative
bool toNative(void* dest, size_t destlen)

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