GUPnPContextManager

GUPnPContextManager — Manages GUPnPContext objects.

Synopsis

struct              GUPnPContextManager;
GUPnPContextManager * gupnp_context_manager_new         (GMainContext *main_context,
                                                         guint port);
void                gupnp_context_manager_manage_control_point
                                                        (GUPnPContextManager *manager,
                                                         GUPnPControlPoint *control_point);
void                gupnp_context_manager_manage_root_device
                                                        (GUPnPContextManager *manager,
                                                         GUPnPRootDevice *root_device);

Object Hierarchy

  GObject
   +----GUPnPContextManager

Properties

  "context-manager"          GUPnPContextManager*  : Write / Construct Only
  "main-context"             gpointer              : Read / Write / Construct Only
  "port"                     guint                 : Read / Write / Construct Only

Signals

  "context-available"                              : Run Last
  "context-unavailable"                            : Run Last

Description

A Utility class that takes care of creation and destruction of GUPnPContext objects for all available network interfaces as they go up (connect) and down (disconnect), respectively.

Details

struct GUPnPContextManager

struct GUPnPContextManager;

This struct contains private data only, and should be accessed using the functions below.


gupnp_context_manager_new ()

GUPnPContextManager * gupnp_context_manager_new         (GMainContext *main_context,
                                                         guint port);

Create a new GUPnPContextManager.

main_context :

GMainContext to pass to created GUPnPContext objects. [allow-none]

port :

Port to create contexts for, or 0 if you don't care what port is used.

Returns :

A new GUPnPContextManager object.

gupnp_context_manager_manage_control_point ()

void                gupnp_context_manager_manage_control_point
                                                        (GUPnPContextManager *manager,
                                                         GUPnPControlPoint *control_point);

By calling this function, you are asking manager to keep a reference to control_point until it's associated GUPnPContext is no longer available. You usually want to call this function from "context-available" handler after you create a GUPnPControlPoint object for the newly available context.

manager :

A GUPnPContextManager

control_point :

The GUPnPControlPoint to be taken care of

gupnp_context_manager_manage_root_device ()

void                gupnp_context_manager_manage_root_device
                                                        (GUPnPContextManager *manager,
                                                         GUPnPRootDevice *root_device);

By calling this function, you are asking manager to keep a reference to root_device when it's associated GUPnPContext is no longer available. You usually want to call this function from "context-available" handler after you create a GUPnPRootDevice object for the newly available context.

manager :

A GUPnPContextManager

root_device :

The GUPnPRootDevice to be taken care of

Property Details

The "context-manager" property

  "context-manager"          GUPnPContextManager*  : Write / Construct Only

The actual GUPnPContextManager implementation used. This is an internal property and therefore Application developer should just ignore it.


The "main-context" property

  "main-context"             gpointer              : Read / Write / Construct Only

GMainContext to pass to created GUPnPContext objects.


The "port" property

  "port"                     guint                 : Read / Write / Construct Only

port: Port to create contexts for, or 0 if you don't care what port is used by GUPnPContext objects created by this object.

Default value: 0

Signal Details

The "context-available" signal

void                user_function                      (GUPnPContextManager *context_manager,
                                                        GUPnPContext        *context,
                                                        gpointer             user_data)            : Run Last

Signals the availability of new GUPnPContext.

context_manager :

The GUPnPContextManager that received the signal

context :

The now available GUPnPContext

user_data :

user data set when the signal handler was connected.

The "context-unavailable" signal

void                user_function                      (GUPnPContextManager *context_manager,
                                                        GUPnPContext        *context,
                                                        gpointer             user_data)            : Run Last

Signals the unavailability of a GUPnPContext.

context_manager :

The GUPnPContextManager that received the signal

context :

The now unavailable GUPnPContext

user_data :

user data set when the signal handler was connected.