Main Page glibmm Namespaces Book

# Gio::SocketAddress Class Reference

Abstract base class representing endpoints for socket communication. More...

Inheritance diagram for Gio::SocketAddress:

[legend]

List of all members.

## Public Member Functions
virtual | ~SocketAddress ()
GSocketAddress* | gobj ()
| Provides access to the underlying C GObject.
const GSocketAddress* | gobj () const
| Provides access to the underlying C GObject.
GSocketAddress* | gobj_copy ()
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
SocketFamily | get_family () const
| Gets the socket family type of address.
bool | to_native (gpointer dest, gsize destlen)
| Converts a SocketAddress to a native <type>struct sockaddr</type>, which can be passed to low-level functions like connect() or bind().
gssize | get_native_size () const
| Gets the size of address's native <type>struct sockaddr</type>.
## Static Public Member Functions
static Glib::RefPtr <SocketAddress> | create (gpointer native, gsize len)
## Related Functions
(Note that these are not member functions.)
Glib::RefPtr<Gio::SocketAddress> | wrap (GSocketAddress* object, bool take_copy=false)
| A Glib::wrap() method for this object.

## Detailed Description

Abstract base class representing endpoints for socket communication.

## Constructor & Destructor Documentation

virtual Gio::SocketAddress::~SocketAddress | ( |  | ) | `[virtual]`

## Member Function Documentation

GSocketAddress* Gio::SocketAddress::gobj | ( |  | ) | `[inline]`

Provides access to the underlying C GObject.

Reimplemented from Gio::SocketConnectable.

Reimplemented in Gio::InetSocketAddress.

const GSocketAddress* Gio::SocketAddress::gobj | ( |  | ) | const`[inline]`

Provides access to the underlying C GObject.

Reimplemented from Gio::SocketConnectable.

Reimplemented in Gio::InetSocketAddress.

GSocketAddress* Gio::SocketAddress::gobj_copy | ( |  | ) |

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

Reimplemented in Gio::InetSocketAddress.

static Glib::RefPtr<SocketAddress> Gio::SocketAddress::create | ( | gpointer | native,
|  | gsize | len |
| ) |  |  | `[static]`

SocketFamily Gio::SocketAddress::get_family | ( |  | ) | const

Gets the socket family type of address.

Returns:
  The socket family type of address.

.

bool Gio::SocketAddress::to_native | ( | gpointer | dest,
|  | gsize | destlen |
| ) |  |  |

Converts a SocketAddress to a native <type>struct sockaddr</type>, which can be passed to low-level functions like connect() or bind().

Parameters:

  | dest | A pointer to a memory location that will contain the native <type>struct sockaddr</type>.
  | destlen | The size of dest. Must be at least as large as g_socket_address_get_native_size().

Returns:
  `true` if dest was filled in, `false` if address is invalid or destlen is too small.

.

gssize Gio::SocketAddress::get_native_size | ( |  | ) | const

Gets the size of address's native <type>struct sockaddr</type>.

You can use this to allocate memory to pass to g_socket_address_to_native().

Returns:
  The size of the native <type>struct sockaddr</type> that address represents

.

## Friends And Related Function Documentation

Glib::RefPtr<Gio::SocketAddress> wrap | ( | GSocketAddress * | object,
|  | bool | take_copy = `false` |
| ) |  |  | `[related]`

A Glib::wrap() method for this object.

Parameters:

  | object | The C instance.
  | take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref.

Returns:
  A C++ instance that wraps this C instance.

The documentation for this class was generated from the following file:

- socketaddress.h