GUPnPContextManager: GUPnP Reference Manual

## GUPnPContextManager GUPnPContextManager — Manages GUPnPContext objects. |

## Functions

GUPnPContextManager * | gupnp_context_manager_create ()
GUPnPContextManager * | gupnp_context_manager_create_full ()
void | gupnp_context_manager_rescan_control_points ()
void | gupnp_context_manager_manage_control_point ()
void | gupnp_context_manager_manage_root_device ()
guint | gupnp_context_manager_get_port ()
GUPnPWhiteList * | gupnp_context_manager_get_white_list ()
GSocketFamily | gupnp_context_manager_get_socket_family ()
GSSDPUDAVersion | gupnp_context_manager_get_uda_version ()

## Types and Values

| GUPnPContextManager

## 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.

## Functions

### gupnp_context_manager_create ()

    GUPnPContextManager *
    gupnp_context_manager_create (guint port);

Factory-method to create a new GUPnPContextManager. The final type of the GUPnPContextManager depends on the compile-time selection or - in case of NetworkManager - on its availability during runtime. If it is not available, the implementation falls back to the basic Unix context manager instead.

Equivalent to calling gupnp_context_manager_create_full (`GSSDP_UDA_VERSION_1_0`, `G_SOCKET_FAMILY_IPV4`, port);

#### Parameters

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

#### Returns

A new GUPnPContextManager object.

[transfer full]

Since: 0.18.0

### gupnp_context_manager_create_full ()

    GUPnPContextManager *
    gupnp_context_manager_create_full (GSSDPUDAVersion uda_version,
                                       GSocketFamily family,
                                       guint port);

Factory-method to create a new GUPnPContextManager. The final type of the GUPnPContextManager depends on the compile-time selection or - in case of NetworkManager - on its availability during runtime. If it is not available, the implementation falls back to the basic Unix context manager instead.

#### Parameters

uda_version | GSSDPUDAVersion the created contexts should implement (UDA 1.0 or 1.1). For `GSSDP_UDA_VERSION_UNSPECIFIED` for default. |
family | GSocketFamily to create the context for |
port | Port to create contexts for, or 0 if you don't care what port is used. |

#### Returns

A new GUPnPContextManager object.

[transfer full]

Since: 1.2.0

### gupnp_context_manager_rescan_control_points ()

    void
    gupnp_context_manager_rescan_control_points
                                   (GUPnPContextManager *manager);

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.

#### Parameters

manager | A GUPnPContextManager |

Since: 0.20.3

### 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 its 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.

#### Parameters

manager | A GUPnPContextManager |
control_point | The GUPnPControlPoint to be taken care of |

Since: 0.14.0

### 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 its 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.

#### Parameters

manager | A GUPnPContextManager |
root_device | The GUPnPRootDevice to be taken care of |

Since: 0.14.0

### gupnp_context_manager_get_port ()

    guint
    gupnp_context_manager_get_port (GUPnPContextManager *manager);

Get the network port associated with this context manager.

#### Parameters

manager | A GUPnPContextManager |

#### Returns

The network port asssociated with this context manager.

Since: 0.20.0

### gupnp_context_manager_get_white_list ()

    GUPnPWhiteList *
    gupnp_context_manager_get_white_list (GUPnPContextManager *manager);

`gupnp_context_manager_get_white_list` has been deprecated since version 1.4.0 and should not be used in newly-written code.

Use `gupnp_context_manager_get_context_filter()` instead.

Get the GUPnPContextFilter associated with `manager` .

#### Parameters

manager | A GUPnPContextManager |

#### Returns

The GUPnPContextFilter asssociated with this context manager.

[transfer none]

### gupnp_context_manager_get_socket_family ()

    GSocketFamily
    gupnp_context_manager_get_socket_family
                                   (GUPnPContextManager *manager);

Get the GSocketFamily the contexts are created for. Can be `G_SOCKET_FAMILY_IPV6`, `G_SOCKET_FAMILY_IPV4` or `G_SOCKET_FAMILY_INVALID` for both

#### Parameters

manager | A GUPnPContextManager |

#### Returns

The socket family

Since: 1.2.0

### gupnp_context_manager_get_uda_version ()

    GSSDPUDAVersion
    gupnp_context_manager_get_uda_version (GUPnPContextManager *manager);

Get the UDA protocol version the contexts are implementing

#### Parameters

manager | A GUPnPContextManager |

#### Returns

The UDA protocol version

Since: 1.2.0

## Types and Values

### GUPnPContextManager

    typedef struct _GUPnPContextManager GUPnPContextManager;