Class: Gio::SocketAddress

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

Instance Method Summary collapse

Instance Method Details

#familyGio::SocketFamily

Returns family.

Returns:

#family=(family) ⇒ Gio::SocketFamily

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

#new_from_native(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

Returns:

  • (Gio::SocketAddress)

    a new GSocket::Address if native could successfully be converted, otherwise nil

#to_native(dest, destlen) ⇒ TrueClass

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:

  • (TrueClass)

    true if dest was filled in, false on error