Address
Object Hierarchy:
Description:
Namespace: Soup
Package: libsoup-2.4
Content:
Properties:
- public AddressFamily family { get; construct; }
- public string name { get; construct; }
- public string physical { get; }
- public int port { get; construct; }
- public string protocol { owned get; construct; }
- public void* sockaddr { get; construct; }
Creation methods:
- public Address (string name, uint port)
Creates a Address from
name
andport
. - public Address.any (AddressFamily family, uint port)
Returns a Address corresponding to the "any" address for
family
(ornull
iffamily
isn't supported), suitable for using as a listening Socket. - public Address.from_sockaddr (void* sa, int len)
Returns a Address equivalent to
sa
(ornull
ifsa
's address family isn't supported)
Methods:
- public bool equal_by_ip (Address addr2)
Tests if this and
addr2
have the same IP address. - public bool equal_by_name (Address addr2)
Tests if this and
addr2
have the same "name". - public SocketAddress get_gsockaddr ()
Creates a new SocketAddress corresponding to this (which is assumed to only have one socket address associated with it).
- public unowned string? get_name ()
Returns the hostname associated with this.
- public unowned string? get_physical ()
Returns the physical address associated with this as a string.
- public uint get_port ()
Returns the port associated with this.
- public void* get_sockaddr (out int len)
Returns the sockaddr associated with this, with its length in *
len
. - public uint hash_by_ip ()
A hash function (for GenericSet) that corresponds to equal_by_ip, qv
- public uint hash_by_name ()
A hash function (for GenericSet) that corresponds to equal_by_name, qv
- public bool is_resolved ()
Tests if this has already been resolved.
- public void resolve_async (MainContext? async_context, Cancellable? cancellable, AddressCallback callback)
Asynchronously resolves the missing half of this (its IP address if it was created with Address, or its hostname if it was created with Address.from_sockaddr or Address.any.
- public uint resolve_sync (Cancellable? cancellable = null)
Synchronously resolves the missing half of this , as with resolve_async.
Inherited Members:
All known members inherited from class GLib.Object
All known members inherited from interface GLib.SocketConnectable