glibmm 2.31.16
|
ProxyResolver - Asynchronous and cancellable network proxy resolver. More...
#include <giomm/proxyresolver.h>
Public Member Functions | |
virtual | ~ProxyResolver () |
GProxyResolver* | gobj () |
Provides access to the underlying C GObject. | |
const GProxyResolver* | gobj () const |
Provides access to the underlying C GObject. | |
bool | is_supported () const |
Checks if resolver can be used on this system. | |
std::vector< Glib::ustring > | lookup (const Glib::ustring& uri, const Glib::RefPtr< Cancellable >& cancellable) |
Looks into the system proxy configuration to determine what proxy, if any, to use to connect to uri. | |
std::vector< Glib::ustring > | lookup (const Glib::ustring& uri) |
Looks into the system proxy configuration to determine what proxy, if any, to use to connect to uri. | |
void | lookup_async (const Glib::ustring& uri, const SlotAsyncReady& slot, const Glib::RefPtr< Cancellable >& cancellable) |
Asynchronous lookup of proxy. | |
void | lookup_async (const Glib::ustring& uri, const SlotAsyncReady& slot) |
Asynchronous lookup of proxy. | |
std::vector< Glib::ustring > | lookup_finish (const Glib::RefPtr< AsyncResult >& result) |
Call this function to obtain the array of proxy URIs when g_proxy_resolver_lookup_async() is complete. | |
Static Public Member Functions | |
static void | add_interface (GType gtype_implementer) |
static Glib::RefPtr < ProxyResolver > | get_default () |
Gets the default ProxyResolver for the system. | |
Related Functions | |
(Note that these are not member functions.) | |
Glib::RefPtr< Gio::ProxyResolver > | wrap (GProxyResolver* object, bool take_copy=false) |
A Glib::wrap() method for this object. |
ProxyResolver - Asynchronous and cancellable network proxy resolver.
ProxyResolver provides synchronous and asynchronous network proxy resolution. ProxyResolver is used within ClientSocket through the method Gio::SocketConnectable::proxy_enumerate().
virtual Gio::ProxyResolver::~ProxyResolver | ( | ) | [virtual] |
static void Gio::ProxyResolver::add_interface | ( | GType | gtype_implementer | ) | [static] |
static Glib::RefPtr<ProxyResolver> Gio::ProxyResolver::get_default | ( | ) | [static] |
Gets the default ProxyResolver for the system.
GProxyResolver* Gio::ProxyResolver::gobj | ( | ) | [inline] |
Provides access to the underlying C GObject.
Reimplemented from Glib::Interface.
const GProxyResolver* Gio::ProxyResolver::gobj | ( | ) | const [inline] |
Provides access to the underlying C GObject.
Reimplemented from Glib::Interface.
bool Gio::ProxyResolver::is_supported | ( | ) | const |
Checks if resolver can be used on this system.
(This is used internally; g_proxy_resolver_get_default() will only return a proxy resolver that returns true
for this method.)
true
if resolver is supported. std::vector<Glib::ustring> Gio::ProxyResolver::lookup | ( | const Glib::ustring& | uri | ) |
Looks into the system proxy configuration to determine what proxy, if any, to use to connect to uri.
The returned proxy URIs are of the form <protocol>://[user[:password]@]host:port or direct://, where <protocol> could be http, rtsp, socks or other proxying protocol.
If you don't know what network protocol is being used on the socket, you should use none as the URI protocol. In this case, the resolver might still return a generic proxy type (such as SOCKS), but would not return protocol-specific proxy types (such as http).
direct:// is used when no proxy is needed. Direct connection should not be attempted unless it is part of the returned array of proxies.
uri | a URI representing the destination to connect to. |
std::vector<Glib::ustring> Gio::ProxyResolver::lookup | ( | const Glib::ustring& | uri, |
const Glib::RefPtr< Cancellable >& | cancellable | ||
) |
Looks into the system proxy configuration to determine what proxy, if any, to use to connect to uri.
The returned proxy URIs are of the form <protocol>://[user[:password]@]host:port
or direct://
, where <protocol> could be http, rtsp, socks or other proxying protocol.
If you don't know what network protocol is being used on the socket, you should use none
as the URI protocol. In this case, the resolver might still return a generic proxy type (such as SOCKS), but would not return protocol-specific proxy types (such as http).
direct://
is used when no proxy is needed. Direct connection should not be attempted unless it is part of the returned array of proxies.
uri | A URI representing the destination to connect to. |
cancellable | A Cancellable, or 0 . |
0
-terminated array of proxy URIs. Must be freed with Glib::strfreev(). void Gio::ProxyResolver::lookup_async | ( | const Glib::ustring& | uri, |
const SlotAsyncReady & | slot, | ||
const Glib::RefPtr< Cancellable >& | cancellable | ||
) |
Asynchronous lookup of proxy.
See lookup() for more details.
uri | a URI representing the destination to connect to. |
slot | A callback slot to call after the resolution completes. |
cancellable | A Cancellable object which can be used to cancel the operation. |
void Gio::ProxyResolver::lookup_async | ( | const Glib::ustring& | uri, |
const SlotAsyncReady & | slot | ||
) |
Asynchronous lookup of proxy.
See lookup() for more details.
uri | a URI representing the destination to connect to. |
slot | A callback slot to call after the resolution completes. |
std::vector<Glib::ustring> Gio::ProxyResolver::lookup_finish | ( | const Glib::RefPtr< AsyncResult >& | result | ) |
Call this function to obtain the array of proxy URIs when g_proxy_resolver_lookup_async() is complete.
See g_proxy_resolver_lookup() for more details.
result | The result passed to your AsyncReadyCallback. |
0
-terminated array of proxy URIs. Must be freed with Glib::strfreev(). Glib::RefPtr< Gio::ProxyResolver > wrap | ( | GProxyResolver * | object, |
bool | take_copy = false |
||
) | [related] |
A Glib::wrap() method for this object.
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. |