• Home
  • Raw
  • Download

Lines Matching +full:srv +full:- +full:ipv4 +full:- +full:simple +full:- +full:service +full:- +full:config

1 /*  GIO - GLib Input, Output and Streaming Library
24 #include "config.h"
52 #include "gmarshal-internal.h"
61 * @short_description: Helper for connecting to a network service
65 * #GSocketClient is a lightweight high-level utility class for connecting to
129 family = client->priv->family; in G_DEFINE_TYPE_WITH_PRIVATE()
131 client->priv->local_address != NULL) in G_DEFINE_TYPE_WITH_PRIVATE()
132 family = g_socket_address_get_family (client->priv->local_address); in G_DEFINE_TYPE_WITH_PRIVATE()
137 client->priv->type, in G_DEFINE_TYPE_WITH_PRIVATE()
138 client->priv->protocol, in G_DEFINE_TYPE_WITH_PRIVATE()
143 if (client->priv->local_address) in G_DEFINE_TYPE_WITH_PRIVATE()
146 client->priv->local_address, in G_DEFINE_TYPE_WITH_PRIVATE()
155 if (client->priv->timeout) in G_DEFINE_TYPE_WITH_PRIVATE()
156 g_socket_set_timeout (socket, client->priv->timeout); in G_DEFINE_TYPE_WITH_PRIVATE()
164 GSocketClientPrivate *priv = client->priv; in can_use_proxy()
166 return priv->enable_proxy in can_use_proxy()
167 && priv->type == G_SOCKET_TYPE_STREAM; in can_use_proxy()
207 client->priv = g_socket_client_get_instance_private (client); in g_socket_client_init()
208 client->priv->type = G_SOCKET_TYPE_STREAM; in g_socket_client_init()
209 client->priv->app_proxies = g_hash_table_new_full (g_str_hash, in g_socket_client_init()
236 g_clear_object (&client->priv->local_address); in g_socket_client_finalize()
237 g_clear_object (&client->priv->proxy_resolver); in g_socket_client_finalize()
239 G_OBJECT_CLASS (g_socket_client_parent_class)->finalize (object); in g_socket_client_finalize()
241 g_hash_table_unref (client->priv->app_proxies); in g_socket_client_finalize()
255 g_value_set_enum (value, client->priv->family); in g_socket_client_get_property()
259 g_value_set_enum (value, client->priv->type); in g_socket_client_get_property()
263 g_value_set_enum (value, client->priv->protocol); in g_socket_client_get_property()
267 g_value_set_object (value, client->priv->local_address); in g_socket_client_get_property()
271 g_value_set_uint (value, client->priv->timeout); in g_socket_client_get_property()
275 g_value_set_boolean (value, client->priv->enable_proxy); in g_socket_client_get_property()
361 return client->priv->family; in g_socket_client_get_family()
375 * connection to be an ipv4 socket, even though the address might
376 * be an ipv6 mapped to ipv4 address.
384 if (client->priv->family == family) in g_socket_client_set_family()
387 client->priv->family = family; in g_socket_client_set_family()
406 return client->priv->type; in g_socket_client_get_socket_type()
427 if (client->priv->type == type) in g_socket_client_set_socket_type()
430 client->priv->type = type; in g_socket_client_set_socket_type()
449 return client->priv->protocol; in g_socket_client_get_protocol()
470 if (client->priv->protocol == protocol) in g_socket_client_set_protocol()
473 client->priv->protocol = protocol; in g_socket_client_set_protocol()
492 return client->priv->local_address; in g_socket_client_get_local_address()
517 if (client->priv->local_address) in g_socket_client_set_local_address()
519 g_object_unref (client->priv->local_address); in g_socket_client_set_local_address()
521 client->priv->local_address = address; in g_socket_client_set_local_address()
522 g_object_notify (G_OBJECT (client), "local-address"); in g_socket_client_set_local_address()
540 return client->priv->timeout; in g_socket_client_get_timeout()
562 if (client->priv->timeout == timeout) in g_socket_client_set_timeout()
565 client->priv->timeout = timeout; in g_socket_client_set_timeout()
582 return client->priv->enable_proxy; in g_socket_client_get_enable_proxy()
604 if (client->priv->enable_proxy == enable) in g_socket_client_set_enable_proxy()
607 client->priv->enable_proxy = enable; in g_socket_client_set_enable_proxy()
608 g_object_notify (G_OBJECT (client), "enable-proxy"); in g_socket_client_set_enable_proxy()
625 return client->priv->tls; in g_socket_client_get_tls()
645 * setting a client-side certificate to use, or connecting to the
646 * #GTlsConnection::accept-certificate signal), you can connect to
659 if (tls == client->priv->tls) in g_socket_client_set_tls()
662 client->priv->tls = tls; in g_socket_client_set_tls()
680 return client->priv->tls_validation_flags; in g_socket_client_get_tls_validation_flags()
697 if (client->priv->tls_validation_flags != flags) in g_socket_client_set_tls_validation_flags()
699 client->priv->tls_validation_flags = flags; in g_socket_client_set_tls_validation_flags()
700 g_object_notify (G_OBJECT (client), "tls-validation-flags"); in g_socket_client_set_tls_validation_flags()
720 if (client->priv->proxy_resolver) in g_socket_client_get_proxy_resolver()
721 return client->priv->proxy_resolver; in g_socket_client_get_proxy_resolver()
737 * depends on the setting of #GSocketClient:enable-proxy, which is not
753 if (client->priv->proxy_resolver) in g_socket_client_set_proxy_resolver()
754 g_object_unref (client->priv->proxy_resolver); in g_socket_client_set_proxy_resolver()
756 client->priv->proxy_resolver = proxy_resolver; in g_socket_client_set_proxy_resolver()
758 if (client->priv->proxy_resolver) in g_socket_client_set_proxy_resolver()
759 g_object_ref (client->priv->proxy_resolver); in g_socket_client_set_proxy_resolver()
767 gobject_class->finalize = g_socket_client_finalize; in g_socket_client_class_init()
768 gobject_class->set_property = g_socket_client_set_property; in g_socket_client_class_init()
769 gobject_class->get_property = g_socket_client_get_property; in g_socket_client_class_init()
783 * - %G_SOCKET_CLIENT_RESOLVING: @client is about to look up @connectable in g_socket_client_class_init()
786 * - %G_SOCKET_CLIENT_RESOLVED: @client has successfully resolved in g_socket_client_class_init()
789 * - %G_SOCKET_CLIENT_CONNECTING: @client is about to make a connection in g_socket_client_class_init()
795 * - %G_SOCKET_CLIENT_CONNECTED: @client has successfully connected in g_socket_client_class_init()
798 * - %G_SOCKET_CLIENT_PROXY_NEGOTIATING: @client is about to negotiate in g_socket_client_class_init()
802 * - %G_SOCKET_CLIENT_PROXY_NEGOTIATED: @client has negotiated a in g_socket_client_class_init()
807 * - %G_SOCKET_CLIENT_TLS_HANDSHAKING: @client is about to begin a TLS in g_socket_client_class_init()
810 * - %G_SOCKET_CLIENT_TLS_HANDSHAKED: @client has successfully completed in g_socket_client_class_init()
813 * - %G_SOCKET_CLIENT_COMPLETE: @client has either successfully connected in g_socket_client_class_init()
876 g_param_spec_object ("local-address", in g_socket_client_class_init()
894 g_param_spec_boolean ("enable-proxy", in g_socket_client_class_init()
911 g_param_spec_flags ("tls-validation-flags", in g_socket_client_class_init()
921 * GSocketClient:proxy-resolver: in g_socket_client_class_init()
928 g_param_spec_object ("proxy-resolver", in g_socket_client_class_init()
992 if (client->priv->proxy_resolver && in g_socket_client_connect()
996 "proxy-resolver", client->priv->proxy_resolver, in g_socket_client_connect()
1044 client->priv->enable_proxy); in g_socket_client_connect()
1086 g_critical ("Trying to proxy over non-TCP connection, this is " in g_socket_client_connect()
1091 _("Proxying over a non-TCP connection is not supported.")); in g_socket_client_connect()
1096 else if (g_hash_table_contains (client->priv->app_proxies, protocol)) in g_socket_client_connect()
1127 if (!application_proxy && connection && client->priv->tls) in g_socket_client_connect()
1138 client->priv->tls_validation_flags); in g_socket_client_connect()
1184 * address, an IPv4 address, or a domain name (in which case a DNS
1206 * In the event of any failure (DNS error, service not found, no hosts
1207 * connectable) %NULL is returned and @error (if non-%NULL) is set
1239 * @service: the name of the service to connect to
1243 * Attempts to create a TCP connection to a service.
1245 * This call looks up the SRV record for @service at @domain for the
1247 * the hosts providing the service until either a connection succeeds
1254 * In the event of any failure (DNS error, service not found, no hosts
1255 * connectable) %NULL is returned and @error (if non-%NULL) is set
1263 const gchar *service, in g_socket_client_connect_to_service() argument
1270 connectable = g_network_service_new (service, "tcp", domain); in g_socket_client_connect_to_service()
1298 * determine when to use application-specific proxy protocols.
1304 * In the event of any failure (DNS error, service not found, no hosts
1305 * connectable) %NULL is returned and @error (if non-%NULL) is set
1357 data->task = NULL; in g_socket_client_async_connect_data_free()
1358 g_clear_object (&data->connectable); in g_socket_client_async_connect_data_free()
1359 g_clear_object (&data->enumerator); in g_socket_client_async_connect_data_free()
1360 g_clear_object (&data->enumeration_cancellable); in g_socket_client_async_connect_data_free()
1361 g_slist_free_full (data->connection_attempts, connection_attempt_unref); in g_socket_client_async_connect_data_free()
1362 g_slist_free_full (data->successful_connections, connection_attempt_unref); in g_socket_client_async_connect_data_free()
1364 g_clear_error (&data->last_error); in g_socket_client_async_connect_data_free()
1385 g_ref_count_init (&attempt->ref); in connection_attempt_new()
1392 g_ref_count_inc (&attempt->ref); in connection_attempt_ref()
1400 if (g_ref_count_dec (&attempt->ref)) in connection_attempt_unref()
1402 g_clear_object (&attempt->address); in connection_attempt_unref()
1403 g_clear_object (&attempt->socket); in connection_attempt_unref()
1404 g_clear_object (&attempt->connection); in connection_attempt_unref()
1405 g_clear_object (&attempt->cancellable); in connection_attempt_unref()
1406 g_clear_object (&attempt->proxy_addr); in connection_attempt_unref()
1407 if (attempt->timeout_source) in connection_attempt_unref()
1409 g_source_destroy (attempt->timeout_source); in connection_attempt_unref()
1410 g_source_unref (attempt->timeout_source); in connection_attempt_unref()
1419 attempt->data->connection_attempts = g_slist_remove (attempt->data->connection_attempts, attempt); in connection_attempt_remove()
1428 for (l = data->connection_attempts; l; l = g_slist_next (l)) in cancel_all_attempts()
1430 ConnectionAttempt *attempt_entry = l->data; in cancel_all_attempts()
1431 g_cancellable_cancel (attempt_entry->cancellable); in cancel_all_attempts()
1434 g_slist_free (data->connection_attempts); in cancel_all_attempts()
1435 data->connection_attempts = NULL; in cancel_all_attempts()
1437 g_slist_free_full (data->successful_connections, connection_attempt_unref); in cancel_all_attempts()
1438 data->successful_connections = NULL; in cancel_all_attempts()
1440 g_cancellable_cancel (data->enumeration_cancellable); in cancel_all_attempts()
1446 GSocketClientAsyncConnectData *data = attempt->data; in g_socket_client_async_connect_complete()
1448 g_assert (attempt->connection); in g_socket_client_async_connect_complete()
1449 g_assert (!data->completed); in g_socket_client_async_connect_complete()
1451 if (!G_IS_SOCKET_CONNECTION (attempt->connection)) in g_socket_client_async_connect_complete()
1455 wrapper_connection = g_tcp_wrapper_connection_new (attempt->connection, attempt->socket); in g_socket_client_async_connect_complete()
1456 g_object_unref (attempt->connection); in g_socket_client_async_connect_complete()
1457 attempt->connection = (GIOStream *)wrapper_connection; in g_socket_client_async_connect_complete()
1460 data->completed = TRUE; in g_socket_client_async_connect_complete()
1463 if (g_cancellable_set_error_if_cancelled (g_task_get_cancellable (data->task), &error)) in g_socket_client_async_connect_complete()
1466 g_socket_client_emit_event (data->client, G_SOCKET_CLIENT_COMPLETE, data->connectable, NULL); in g_socket_client_async_connect_complete()
1467 g_task_return_error (data->task, g_steal_pointer (&error)); in g_socket_client_async_connect_complete()
1472 …g_socket_client_emit_event (data->client, G_SOCKET_CLIENT_COMPLETE, data->connectable, attempt->co… in g_socket_client_async_connect_complete()
1473 g_task_return_pointer (data->task, g_steal_pointer (&attempt->connection), g_object_unref); in g_socket_client_async_connect_complete()
1477 g_object_unref (data->task); in g_socket_client_async_connect_complete()
1490 g_clear_error (&data->last_error); in set_last_error()
1491 data->last_error = error; in set_last_error()
1501 g_object_ref (data->task); in enumerator_next_async()
1503 g_socket_client_emit_event (data->client, G_SOCKET_CLIENT_RESOLVING, data->connectable, NULL); in enumerator_next_async()
1505 g_socket_address_enumerator_next_async (data->enumerator, in enumerator_next_async()
1506 data->enumeration_cancellable, in enumerator_next_async()
1519 GSocketClientAsyncConnectData *data = attempt->data; in g_socket_client_tls_handshake_callback()
1523 &data->last_error)) in g_socket_client_tls_handshake_callback()
1525 g_object_unref (attempt->connection); in g_socket_client_tls_handshake_callback()
1526 attempt->connection = G_IO_STREAM (object); in g_socket_client_tls_handshake_callback()
1529 …g_socket_client_emit_event (data->client, G_SOCKET_CLIENT_TLS_HANDSHAKED, data->connectable, attem… in g_socket_client_tls_handshake_callback()
1536 g_debug ("GSocketClient: TLS handshake failed: %s", data->last_error->message); in g_socket_client_tls_handshake_callback()
1544 GSocketClientAsyncConnectData *data = attempt->data; in g_socket_client_tls_handshake()
1547 if (!data->client->priv->tls) in g_socket_client_tls_handshake()
1554 tlsconn = g_tls_client_connection_new (attempt->connection, in g_socket_client_tls_handshake()
1555 data->connectable, in g_socket_client_tls_handshake()
1556 &data->last_error); in g_socket_client_tls_handshake()
1560 data->client->priv->tls_validation_flags); in g_socket_client_tls_handshake()
1561 …g_socket_client_emit_event (data->client, G_SOCKET_CLIENT_TLS_HANDSHAKING, data->connectable, G_IO… in g_socket_client_tls_handshake()
1564 g_task_get_cancellable (data->task), in g_socket_client_tls_handshake()
1581 GSocketClientAsyncConnectData *data = attempt->data; in g_socket_client_proxy_connect_callback()
1583 g_object_unref (attempt->connection); in g_socket_client_proxy_connect_callback()
1584 attempt->connection = g_proxy_connect_finish (G_PROXY (object), in g_socket_client_proxy_connect_callback()
1586 &data->last_error); in g_socket_client_proxy_connect_callback()
1587 if (attempt->connection) in g_socket_client_proxy_connect_callback()
1589 …g_socket_client_emit_event (data->client, G_SOCKET_CLIENT_PROXY_NEGOTIATED, data->connectable, att… in g_socket_client_proxy_connect_callback()
1605 g_debug ("GSocketClient: Connection failed: %s", error->message); in complete_connection_with_error()
1606 g_assert (!data->completed); in complete_connection_with_error()
1608 g_socket_client_emit_event (data->client, G_SOCKET_CLIENT_COMPLETE, data->connectable, NULL); in complete_connection_with_error()
1609 data->completed = TRUE; in complete_connection_with_error()
1611 g_task_return_error (data->task, error); in complete_connection_with_error()
1617 GTask *task = data->task; in task_completed_or_cancelled()
1621 if (data->completed) in task_completed_or_cancelled()
1639 if (data->connection_in_progress) in try_next_successful_connection()
1642 g_assert (data->successful_connections != NULL); in try_next_successful_connection()
1643 attempt = data->successful_connections->data; in try_next_successful_connection()
1645 data->successful_connections = g_slist_remove (data->successful_connections, attempt); in try_next_successful_connection()
1646 data->connection_in_progress = TRUE; in try_next_successful_connection()
1650 if (!attempt->proxy_addr) in try_next_successful_connection()
1656 protocol = g_proxy_address_get_protocol (attempt->proxy_addr); in try_next_successful_connection()
1661 if (!G_IS_TCP_CONNECTION (attempt->connection)) in try_next_successful_connection()
1663 g_critical ("Trying to proxy over non-TCP connection, this is " in try_next_successful_connection()
1666 g_set_error_literal (&data->last_error, in try_next_successful_connection()
1668 _("Proxying over a non-TCP connection is not supported.")); in try_next_successful_connection()
1670 else if (g_hash_table_contains (data->client->priv->app_proxies, protocol)) in try_next_successful_connection()
1679 GIOStream *connection = attempt->connection; in try_next_successful_connection()
1680 GProxyAddress *proxy_addr = attempt->proxy_addr; in try_next_successful_connection()
1682 …g_socket_client_emit_event (data->client, G_SOCKET_CLIENT_PROXY_NEGOTIATING, data->connectable, at… in try_next_successful_connection()
1687 g_task_get_cancellable (data->task), in try_next_successful_connection()
1695 g_clear_error (&data->last_error); in try_next_successful_connection()
1697 g_set_error (&data->last_error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, in try_next_successful_connection()
1702 data->connection_in_progress = FALSE; in try_next_successful_connection()
1704 return FALSE; /* All non-return paths are failures */ in try_next_successful_connection()
1712 data->connection_in_progress = FALSE; in try_next_connection_or_finish()
1714 if (data->connection_in_progress) in try_next_connection_or_finish()
1718 while (data->successful_connections) in try_next_connection_or_finish()
1724 if (!data->enumeration_completed) in try_next_connection_or_finish()
1730 complete_connection_with_error (data, data->last_error); in try_next_connection_or_finish()
1739 GSocketClientAsyncConnectData *data = attempt->data; in g_socket_client_connected_callback()
1742 if (task_completed_or_cancelled (data) || g_cancellable_is_cancelled (attempt->cancellable)) in g_socket_client_connected_callback()
1744 g_object_unref (data->task); in g_socket_client_connected_callback()
1749 if (attempt->timeout_source) in g_socket_client_connected_callback()
1751 g_source_destroy (attempt->timeout_source); in g_socket_client_connected_callback()
1752 g_clear_pointer (&attempt->timeout_source, g_source_unref); in g_socket_client_connected_callback()
1758 if (!g_cancellable_is_cancelled (attempt->cancellable)) in g_socket_client_connected_callback()
1760 clarify_connect_error (error, data->connectable, attempt->address); in g_socket_client_connected_callback()
1762 g_debug ("GSocketClient: Connection attempt failed: %s", error->message); in g_socket_client_connected_callback()
1770 g_object_unref (data->task); in g_socket_client_connected_callback()
1777 g_socket_connection_set_cached_remote_address ((GSocketConnection*)attempt->connection, NULL); in g_socket_client_connected_callback()
1779 …g_socket_client_emit_event (data->client, G_SOCKET_CLIENT_CONNECTED, data->connectable, attempt->c… in g_socket_client_connected_callback()
1782 g_socket_set_blocking (attempt->socket, TRUE); in g_socket_client_connected_callback()
1790 …data->successful_connections = g_slist_append (data->successful_connections, g_steal_pointer (&att… in g_socket_client_connected_callback()
1799 if (!attempt->data->enumeration_completed) in on_connection_attempt_timeout()
1802 enumerator_next_async (attempt->data, TRUE); in on_connection_attempt_timeout()
1805 g_clear_pointer (&attempt->timeout_source, g_source_unref); in on_connection_attempt_timeout()
1831 g_object_unref (data->task); in g_socket_client_enumerator_callback()
1835 address = g_socket_address_enumerator_next_finish (data->enumerator, in g_socket_client_enumerator_callback()
1839 if (G_UNLIKELY (data->enumeration_completed)) in g_socket_client_enumerator_callback()
1842 data->enumeration_completed = TRUE; in g_socket_client_enumerator_callback()
1853 …if ((data->enumerated_at_least_once && !data->connection_attempts && !data->connection_in_progress… in g_socket_client_enumerator_callback()
1854 !data->enumerated_at_least_once) in g_socket_client_enumerator_callback()
1856 g_debug ("GSocketClient: Address enumeration failed: %s", error ? error->message : NULL); in g_socket_client_enumerator_callback()
1857 if (data->last_error) in g_socket_client_enumerator_callback()
1860 error = data->last_error; in g_socket_client_enumerator_callback()
1861 data->last_error = NULL; in g_socket_client_enumerator_callback()
1873 g_object_unref (data->task); in g_socket_client_enumerator_callback()
1877 data->enumerated_at_least_once = TRUE; in g_socket_client_enumerator_callback()
1879 g_socket_client_emit_event (data->client, G_SOCKET_CLIENT_RESOLVED, in g_socket_client_enumerator_callback()
1880 data->connectable, NULL); in g_socket_client_enumerator_callback()
1882 g_clear_error (&data->last_error); in g_socket_client_enumerator_callback()
1884 socket = create_socket (data->client, address, &data->last_error); in g_socket_client_enumerator_callback()
1893 attempt->data = data; in g_socket_client_enumerator_callback()
1894 attempt->socket = socket; in g_socket_client_enumerator_callback()
1895 attempt->address = address; in g_socket_client_enumerator_callback()
1896 attempt->cancellable = g_cancellable_new (); in g_socket_client_enumerator_callback()
1897 attempt->connection = (GIOStream *)g_socket_connection_factory_create_connection (socket); in g_socket_client_enumerator_callback()
1898 attempt->timeout_source = g_timeout_source_new (HAPPY_EYEBALLS_CONNECTION_ATTEMPT_TIMEOUT_MS); in g_socket_client_enumerator_callback()
1900 if (G_IS_PROXY_ADDRESS (address) && data->client->priv->enable_proxy) in g_socket_client_enumerator_callback()
1901 attempt->proxy_addr = g_object_ref (G_PROXY_ADDRESS (address)); in g_socket_client_enumerator_callback()
1903 g_source_set_callback (attempt->timeout_source, on_connection_attempt_timeout, attempt, NULL); in g_socket_client_enumerator_callback()
1904 g_source_attach (attempt->timeout_source, g_main_context_get_thread_default ()); in g_socket_client_enumerator_callback()
1905 data->connection_attempts = g_slist_append (data->connection_attempts, attempt); in g_socket_client_enumerator_callback()
1907 if (g_task_get_cancellable (data->task)) in g_socket_client_enumerator_callback()
1908 … g_cancellable_connect (g_task_get_cancellable (data->task), G_CALLBACK (on_connection_cancelled), in g_socket_client_enumerator_callback()
1909 g_object_ref (attempt->cancellable), g_object_unref); in g_socket_client_enumerator_callback()
1911 g_socket_connection_set_cached_remote_address ((GSocketConnection *)attempt->connection, address); in g_socket_client_enumerator_callback()
1913 …g_socket_client_emit_event (data->client, G_SOCKET_CLIENT_CONNECTING, data->connectable, attempt->… in g_socket_client_enumerator_callback()
1914 g_socket_connection_connect_async (G_SOCKET_CONNECTION (attempt->connection), in g_socket_client_enumerator_callback()
1916 attempt->cancellable, in g_socket_client_enumerator_callback()
1948 data->client = client; in g_socket_client_connect_async()
1949 data->connectable = g_object_ref (connectable); in g_socket_client_connect_async()
1953 data->enumerator = g_socket_connectable_proxy_enumerate (connectable); in g_socket_client_connect_async()
1954 if (client->priv->proxy_resolver && in g_socket_client_connect_async()
1955 G_IS_PROXY_ADDRESS_ENUMERATOR (data->enumerator)) in g_socket_client_connect_async()
1957 g_object_set (G_OBJECT (data->enumerator), in g_socket_client_connect_async()
1958 "proxy-resolver", client->priv->proxy_resolver, in g_socket_client_connect_async()
1963 data->enumerator = g_socket_connectable_enumerate (connectable); in g_socket_client_connect_async()
1966 which is simple enough but much of it is done in parallel to be as responsive in g_socket_client_connect_async()
1971 - This may be triggered multiple times by enumerator_next_async(). in g_socket_client_connect_async()
1972 - It also has its own cancellable (data->enumeration_cancellable). in g_socket_client_connect_async()
1973 - Enumeration is done lazily because GNetworkAddressAddressEnumerator in g_socket_client_connect_async()
1975 - If the first enumeration errors then the task errors. Otherwise all enumerations in g_socket_client_connect_async()
1979 - Each connection is independent and kept in a ConnectionAttempt object. in g_socket_client_connect_async()
1980 - They each hold a ref on the main task and have their own cancellable. in g_socket_client_connect_async()
1981 - Multiple attempts may happen in parallel as per Happy Eyeballs. in g_socket_client_connect_async()
1982 - Upon failure or timeouts more connection attempts are made. in g_socket_client_connect_async()
1983 - If no connections succeed the task errors. in g_socket_client_connect_async()
1984 - Upon success they are kept in a list of successful connections. in g_socket_client_connect_async()
1987 - These are done in serial. in g_socket_client_connect_async()
1988 - The reasoning here is that Happy Eyeballs is about making bad connections responsive in g_socket_client_connect_async()
1991 - Upon failure it will try the next TCP connection until it runs out and in g_socket_client_connect_async()
1993 - Upon success it cancels everything remaining (enumeration and connections) in g_socket_client_connect_async()
1997 data->task = g_task_new (client, cancellable, callback, user_data); in g_socket_client_connect_async()
1998 g_task_set_check_cancellable (data->task, FALSE); /* We handle this manually */ in g_socket_client_connect_async()
1999 g_task_set_source_tag (data->task, g_socket_client_connect_async); in g_socket_client_connect_async()
2000 g_task_set_task_data (data->task, data, (GDestroyNotify)g_socket_client_async_connect_data_free); in g_socket_client_connect_async()
2002 data->enumeration_cancellable = g_cancellable_new (); in g_socket_client_connect_async()
2005 g_object_ref (data->enumeration_cancellable), g_object_unref); in g_socket_client_connect_async()
2060 * @service: the name of the service to connect to
2073 const gchar *service, in g_socket_client_connect_to_service_async() argument
2080 connectable = g_network_service_new (service, "tcp", domain); in g_socket_client_connect_to_service_async()
2249 g_hash_table_add (client->priv->app_proxies, g_strdup (protocol)); in g_socket_client_add_application_proxy()