[ CCode ( cprefix = "SOUP_KNOWN_STATUS_CODE_" , type_id = "soup_known_status_code_get_type ()" ) ]
[ Version ( deprecated = true , deprecated_since = "2.44" , replacement = "Status" ) ]
public enum KnownStatusCode
Warning: KnownStatusCode is deprecated since 2.44. Use Status.
Example: Resolve an address, async:
public static int main (string[] args) {
MainLoop loop = new MainLoop ();
MainContext context = loop.get_context ();
Soup.Address address = new Soup.Address ("www.gnome.org", 80);
Cancellable cancellable = new Cancellable ();
// Use cancellable.cancel () to abort the resolution
address.resolve_async (context, cancellable, (addr, status) => {
switch (status) {
case Soup.Status.OK:
print ("Resolved! %s\n", addr.get_physical ());
break;
case Soup.Status.CANT_RESOLVE:
print ("Error: Unable to resolve destination host name.\n");
break;
case Soup.Status.CANCELLED:
print ("Error: Message was cancelled locally.\n");
break;
default:
assert_not_reached ();
}
loop.quit ();
});
loop.run ();
return 0;
}
valac --pkg libsoup-2.4 message-resolve-async.vala