Constructor

GioNetworkAddressnew

since: 2.22

Declaration

GSocketConnectable*
g_network_address_new (
  const gchar* hostname,
  guint16 port
)

Description

Creates a new GSocketConnectable for connecting to the given hostname and port.

Note that depending on the configuration of the machine, a hostname of localhost may refer to the IPv4 loopback address only, or to both IPv4 and IPv6; use g_network_address_new_loopback() to create a GNetworkAddress that is guaranteed to resolve to both addresses.

Available since: 2.22

Parameters

hostname

Type: const gchar*

The hostname.

The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.
port

Type: guint16

The port.

Return value

Type: GNetworkAddress

The new GNetworkAddress.

The caller of the function takes ownership of the data, and is responsible for freeing it.