GUPnPContext

GUPnPContext — Context object wrapping shared networking bits.

Synopsis




                    GUPnPContextPrivate;
                    GUPnPContext;
GUPnPContext*       gupnp_context_new                   (GMainContext *main_context,
                                                         const char *host_ip,
                                                         guint port,
                                                         GError **error);
const char*         gupnp_context_get_host_ip           (GUPnPContext *context);
guint               gupnp_context_get_port              (GUPnPContext *context);
void                gupnp_context_set_subscription_timeout
                                                        (GUPnPContext *context,
                                                         guint timeout);
guint               gupnp_context_get_subscription_timeout
                                                        (GUPnPContext *context);

Object Hierarchy


  GObject
   +----GSSDPClient
         +----GUPnPContext

Properties


  "host-ip"                  gchararray            : Read / Write / Construct Only
  "port"                     guint                 : Read / Write / Construct Only
  "subscription-timeout"     guint                 : Read / Write / Construct Only

Description

GUPnPContext wraps the networking bits that are used by the various GUPnP classes. It automatically starts a web server on demand.

Details

GUPnPContextPrivate

typedef struct _GUPnPContextPrivate GUPnPContextPrivate;


GUPnPContext

typedef struct _GUPnPContext GUPnPContext;


gupnp_context_new ()

GUPnPContext*       gupnp_context_new                   (GMainContext *main_context,
                                                         const char *host_ip,
                                                         guint port,
                                                         GError **error);

main_context : A GMainContext, or NULL to use the default one
host_ip : The local host's IP address, or NULL to use the IP address of the first non-loopback network interface.
port : Port to run on, or 0 if you don't care what port is used.
error : A location to store a GError, or NULL
Returns : A new GUPnPContext object.

gupnp_context_get_host_ip ()

const char*         gupnp_context_get_host_ip           (GUPnPContext *context);

context : A GUPnPContext
Returns : The IP address we advertise ourselves as using. Do not free.

gupnp_context_get_port ()

guint               gupnp_context_get_port              (GUPnPContext *context);

context : A GUPnPContext
Returns : The port the SOAP server is running on.

gupnp_context_set_subscription_timeout ()

void                gupnp_context_set_subscription_timeout
                                                        (GUPnPContext *context,
                                                         guint timeout);

Sets the event subscription timeout to timeout. Use 0 if you don't want subscriptions to time out. Note that any client side subscriptions will automatically be renewed.

context : A GUPnPContext
timeout : Event subscription timeout in seconds

gupnp_context_get_subscription_timeout ()

guint               gupnp_context_get_subscription_timeout
                                                        (GUPnPContext *context);

context : A GUPnPContext
Returns : The event subscription timeout in seconds, or 0, meaning no timeout.

Property Details

The "host-ip" property

  "host-ip"                  gchararray            : Read / Write / Construct Only

The local host's IP address. Set to NULL to autodetect.

Default value: NULL


The "port" property

  "port"                     guint                 : Read / Write / Construct Only

The port to run on. Set to 0 if you don't care what port to run on.

Default value: 0


The "subscription-timeout" property

  "subscription-timeout"     guint                 : Read / Write / Construct Only

The preferred subscription timeout: the number of seconds after which subscriptions are renewed.

Default value: 1800