Constructor

GioInetAddressnew_from_bytes

since: 2.22

Declaration

GInetAddress*
g_inet_address_new_from_bytes (
  const guint8* bytes,
  GSocketFamily family
)

Description

Creates a new GInetAddress from the given family and bytes. bytes should be 4 bytes for G_SOCKET_FAMILY_IPV4 and 16 bytes for G_SOCKET_FAMILY_IPV6.

Available since: 2.22

Parameters

bytes

Type: An array of guint8

Raw address data.

The data is owned by the caller of the function.
family

Type: GSocketFamily

The address family of bytes.

Return value

Type: GInetAddress

A new GInetAddress corresponding to family and bytes. Free the returned object with g_object_unref().

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