## GSSDPResourceBrowser

GSSDPResourceBrowser — Class handling resource discovery.

## Synopsis

                        GSSDPResourceBrowser;
    #define             GSSDP_ALL_RESOURCES
    GSSDPResourceBrowser * gssdp_resource_browser_new       (GSSDPClient *client,
                                                             const char *target);
    GSSDPClient *       gssdp_resource_browser_get_client   (GSSDPResourceBrowser *resource_browser);
    void                gssdp_resource_browser_set_target   (GSSDPResourceBrowser *resource_browser,
                                                             const char *target);
    const char *        gssdp_resource_browser_get_target   (GSSDPResourceBrowser *resource_browser);
    void                gssdp_resource_browser_set_mx       (GSSDPResourceBrowser *resource_browser,
                                                             gushort mx);
    gushort             gssdp_resource_browser_get_mx       (GSSDPResourceBrowser *resource_browser);
    void                gssdp_resource_browser_set_active   (GSSDPResourceBrowser *resource_browser,
                                                             gboolean active);
    gboolean            gssdp_resource_browser_get_active   (GSSDPResourceBrowser *resource_browser);

## Object Hierarchy

      GObject
       +----GSSDPResourceBrowser

## Properties

      "active"                   gboolean              : Read / Write
      "client"                   GSSDPClient*          : Read / Write / Construct Only
      "mx"                       guint                 : Read / Write
      "target"                   gchar*                : Read / Write

## Signals

      "resource-available"                             : Run Last
      "resource-unavailable"                           : Run Last

## Description

GUPnPResourceBrowser handles resource discovery. After creating a browser and activating it, the ::resource-available and ::resource-unavailable signals will be emitted whenever the availability of a resource matching the specified discovery target changes. A discovery request is sent out automatically when activating the browser.

## Details

### GSSDPResourceBrowser

    typedef struct _GSSDPResourceBrowser GSSDPResourceBrowser;

### GSSDP_ALL_RESOURCES

    #define GSSDP_ALL_RESOURCES "ssdp:all"

SSDP search target for finding all possible resources.

### gssdp_resource_browser_new ()

    GSSDPResourceBrowser * gssdp_resource_browser_new       (GSSDPClient *client,
                                                             const char *target);

`client` : | The GSSDPClient to associate with
`target` : |
Returns : | A new GSSDPResourceBrowser object.

### gssdp_resource_browser_get_client ()

    GSSDPClient *       gssdp_resource_browser_get_client   (GSSDPResourceBrowser *resource_browser);

`resource_browser` : | A GSSDPResourceBrowser
Returns : | The GSSDPClient `resource_browser` is associated with.

### gssdp_resource_browser_set_target ()

    void                gssdp_resource_browser_set_target   (GSSDPResourceBrowser *resource_browser,
                                                             const char *target);

Sets the browser target of `resource_browser` to `target`.

`resource_browser` : | A GSSDPResourceBrowser
`target` : | The browser target

### gssdp_resource_browser_get_target ()

    const char *        gssdp_resource_browser_get_target   (GSSDPResourceBrowser *resource_browser);

`resource_browser` : | A GSSDPResourceBrowser
Returns : | The browser target.

### gssdp_resource_browser_set_mx ()

    void                gssdp_resource_browser_set_mx       (GSSDPResourceBrowser *resource_browser,
                                                             gushort mx);

Sets the used MX value of `resource_browser` to `mx`.

`resource_browser` : | A GSSDPResourceBrowser
`mx` : | The to be used MX value

### gssdp_resource_browser_get_mx ()

    gushort             gssdp_resource_browser_get_mx       (GSSDPResourceBrowser *resource_browser);

`resource_browser` : | A GSSDPResourceBrowser
Returns : | The used MX value.

### gssdp_resource_browser_set_active ()

    void                gssdp_resource_browser_set_active   (GSSDPResourceBrowser *resource_browser,
                                                             gboolean active);

(De)activates `resource_browser`.

`resource_browser` : | A GSSDPResourceBrowser
`active` : | TRUE to activate `resource_browser`

### gssdp_resource_browser_get_active ()

    gboolean            gssdp_resource_browser_get_active   (GSSDPResourceBrowser *resource_browser);

`resource_browser` : | A GSSDPResourceBrowser
Returns : | TRUE if `resource_browser` is active.

## Property Details

### The `"active"` property

      "active"                   gboolean              : Read / Write

Whether this browser is active or not.

Default value: FALSE

### The `"client"` property

      "client"                   GSSDPClient*          : Read / Write / Construct Only

The GSSDPClient to use.

### The `"mx"` property

      "mx"                       guint                 : Read / Write

The maximum number of seconds in which to request other parties to respond.

Allowed values: [1,65535]

Default value: 3

### The `"target"` property

      "target"                   gchar*                : Read / Write

The discovery target.

Default value: NULL

## Signal Details

### The `"resource-available"` signal

    void                user_function                      (GSSDPResourceBrowser *resource_browser,
                                                            gchar                *usn,
                                                            gpointer              locations,
                                                            gpointer              user_data)             : Run Last

The ::resource-available signal is emitted whenever a new resource has become available.

`resource_browser` : | The GSSDPResourceBrowser that received the signal
`usn` : | The USN of the discovered resource
`locations` : | A GList of strings describing the locations of the discovered resource.
`user_data` : | user data set when the signal handler was connected.

### The `"resource-unavailable"` signal

    void                user_function                      (GSSDPResourceBrowser *resource_browser,
                                                            gchar                *usn,
                                                            gpointer              user_data)             : Run Last

The ::resource-unavailable signal is emitted whenever a resource is not available any more.

`resource_browser` : | The GSSDPResourceBrowser that received the signal
`usn` : | The USN of the resource
`user_data` : | user data set when the signal handler was connected.