+ * camel_network_service_ref_connectable:
+ * @service: a #CamelNetworkService
+ *
+ * Returns the socket endpoint for the network service to which @service
+ * is a client.
+ *
+ * The returned #GSocketConnectable is referenced for thread-safety and
+ * must be unreferenced with g_object_unref() when finished with it.
+ *
+ * Returns: a #GSocketConnectable
+ *
+ * Since: 3.8
+ **/
+GSocketConnectable *
+camel_network_service_ref_connectable (CamelNetworkService *service)
+{
+ CamelNetworkServicePrivate *priv;
+ GSocketConnectable *connectable = NULL;
+
+ g_return_val_if_fail (CAMEL_IS_NETWORK_SERVICE (service), NULL);
+
+ priv = CAMEL_NETWORK_SERVICE_GET_PRIVATE (service);
+ g_return_val_if_fail (priv != NULL, NULL);
+
+ g_mutex_lock (&priv->property_lock);
+
+ if (priv->connectable != NULL)
+ connectable = g_object_ref (priv->connectable);
+
+ g_mutex_unlock (&priv->property_lock);
+
+ return connectable;
+}
+
+/**
+ * camel_network_service_set_connectable:
+ * @service: a #CamelNetworkService
+ * @connectable: a #GSocketConnectable, or %NULL
+ *
+ * Sets the socket endpoint for the network service to which @service is
+ * a client. If @connectable is %NULL, a #GSocketConnectable is derived
+ * from the @service's #CamelNetworkSettings.
+ *
+ * Since: 3.8
+ **/
+void
+camel_network_service_set_connectable (CamelNetworkService *service,
+ GSocketConnectable *connectable)
+{
+ CamelNetworkServiceInterface *interface;
+ CamelNetworkServicePrivate *priv;
+
+ g_return_if_fail (CAMEL_IS_NETWORK_SERVICE (service));
+
+ interface = CAMEL_NETWORK_SERVICE_GET_INTERFACE (service);
+ g_return_if_fail (interface->new_connectable != NULL);
+
+ priv = CAMEL_NETWORK_SERVICE_GET_PRIVATE (service);
+ g_return_if_fail (priv != NULL);
+
+ if (connectable != NULL) {
+ g_return_if_fail (G_IS_SOCKET_CONNECTABLE (connectable));
+ g_object_ref (connectable);
+ } else {
+ /* This may return NULL if we don't have valid network
+ * settings from which to create a GSocketConnectable. */
+ connectable = interface->new_connectable (service);
+ }
+
+ g_mutex_lock (&priv->property_lock);
+
+ if (priv->connectable != NULL)
+ g_object_unref (priv->connectable);
+
+ priv->connectable = connectable;
+
+ g_mutex_unlock (&priv->property_lock);
+
+ g_object_notify (G_OBJECT (service), "connectable");
+}
+
+/**