Class: Gio::SocketAddress

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Instance Method Summary collapse

Constructor Details

#initialize(native, len) ⇒ Gio::SocketAddress

Creates a GSocket::Address subclass corresponding to the native struct sockaddr native.

Parameters:

  • native (GObject)

    a pointer to a struct sockaddr

  • len (Integer)

    the size of the memory location pointed to by native

Instance Method Details

#familyGio::SocketFamily

The family of the socket address.

Returns:

#family=(family) ⇒ Gio::SocketFamily

The family of the socket address.

Parameters:

Returns:

#native_sizeGio::gssize

Gets the size of address's native struct sockaddr. You can use this to allocate memory to pass to g_socket_address_to_native().

Returns:

  • (Gio::gssize)

    the size of the native struct sockaddr that address represents

#to_native(dest, destlen) ⇒ Boolean

Converts a GSocket::Address 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. struct sockaddr

Parameters:

  • dest (GObject)

    a pointer to a memory location that will contain the native

  • destlen (Integer)

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

Returns:

  • (Boolean)

    true if dest was filled in, false on error