[gupnp] Add rescan_control_points feature



commit e7d929aeb4a5871edf3dd00dad2fc054de765b8d
Author: Sébastien Bianti <sebastien bianti linux intel com>
Date:   Mon Apr 8 15:56:09 2013 +0200

    Add rescan_control_points feature
    
    This resolves bug https://bugzilla.gnome.org/show_bug.cgi?id=697314

 doc/gupnp-sections.txt           |    1 +
 libgupnp/gupnp-context-manager.c |   29 +++++++++++++++++++++++++++++
 libgupnp/gupnp-context-manager.h |    4 ++++
 3 files changed, 34 insertions(+), 0 deletions(-)
---
diff --git a/doc/gupnp-sections.txt b/doc/gupnp-sections.txt
index 92fa1f3..d53fd97 100644
--- a/doc/gupnp-sections.txt
+++ b/doc/gupnp-sections.txt
@@ -201,6 +201,7 @@ GUPnPContextPrivate
 GUPnPContextManager
 gupnp_context_manager_new
 gupnp_context_manager_create
+gupnp_context_manager_rescan_control_points
 gupnp_context_manager_manage_control_point
 gupnp_context_manager_manage_root_device
 gupnp_context_manager_get_port
diff --git a/libgupnp/gupnp-context-manager.c b/libgupnp/gupnp-context-manager.c
index 709f6d5..e230877 100644
--- a/libgupnp/gupnp-context-manager.c
+++ b/libgupnp/gupnp-context-manager.c
@@ -377,6 +377,35 @@ gupnp_context_manager_create (guint port)
 }
 
 /**
+ * gupnp_context_manager_rescan_control_points:
+ * @manager: A #GUPnPContextManager
+ *
+ * This function starts a rescan on every control point managed by @manager.
+ * Only the active control points send discovery messages.
+ * This function should be called when servers are suspected to have
+ * disappeared.
+ **/
+void
+gupnp_context_manager_rescan_control_points (GUPnPContextManager *manager)
+{
+        GList *l;
+
+        g_return_if_fail (GUPNP_IS_CONTEXT_MANAGER (manager));
+
+        l = manager->priv->objects;
+
+        while (l) {
+                if (GUPNP_IS_CONTROL_POINT (l->data)) {
+                        GSSDPResourceBrowser *browser =
+                                GSSDP_RESOURCE_BROWSER (l->data);
+                        gssdp_resource_browser_rescan (browser);
+                }
+
+                l = l->next;
+        }
+}
+
+/**
  * gupnp_context_manager_manage_control_point:
  * @manager: A #GUPnPContextManager
  * @control_point: The #GUPnPControlPoint to be taken care of
diff --git a/libgupnp/gupnp-context-manager.h b/libgupnp/gupnp-context-manager.h
index 9fa2154..1e04b4c 100644
--- a/libgupnp/gupnp-context-manager.h
+++ b/libgupnp/gupnp-context-manager.h
@@ -90,6 +90,10 @@ GUPnPContextManager *
 gupnp_context_manager_create           (guint port);
 
 void
+gupnp_context_manager_rescan_control_points
+                                       (GUPnPContextManager *manager);
+
+void
 gupnp_context_manager_manage_control_point
                                        (GUPnPContextManager     *manager,
                                         GUPnPControlPoint       *control_point);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]