Method

GioSocketAddressto_native

Declaration

gboolean
g_socket_address_to_native (
  GSocketAddress* address,
  gpointer dest,
  gsize destlen,
  GError** error
)

Description

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

If not enough space is available, a G_IO_ERROR_NO_SPACE error is returned. If the address type is not known on the system then a G_IO_ERROR_NOT_SUPPORTED error is returned.

Available since:2.22

Parameters

dest gpointer
 

A pointer to a memory location that will contain the native struct sockaddr.

 The argument can be NULL.
 The data is owned by the caller of the function.
destlen gsize
 

The size of dest. Must be at least as large as g_socket_address_get_native_size()

error GError **
  The return location for a GError*, or NULL.

Return value

Returns: gboolean
 

TRUE if dest was filled in, FALSE on error.