![]() |
![]() |
![]() |
GUPnP Reference Manual | ![]() |
---|---|---|---|---|
GUPnPContext; GUPnPContext* gupnp_context_new (GMainContext *main_context, constchar *host_ip,guint port,GError **error); constchar * gupnp_context_get_host_ip (GUPnPContext *context);guint gupnp_context_get_port (GUPnPContext *context);SoupServer * gupnp_context_get_server (GUPnPContext *context);void gupnp_context_set_subscription_timeout (GUPnPContext *context,guint timeout);guint gupnp_context_get_subscription_timeout (GUPnPContext *context);void gupnp_context_host_path (GUPnPContext *context, constchar *local_path, constchar *server_path);void gupnp_context_unhost_path (GUPnPContext *context, constchar *server_path);
"host-ip"gchar * : Read / Write / Construct Only "port"guint : Read / Write / Construct Only "server"SoupServer * : Read "subscription-timeout"guint : Read / Write / Construct Only
GUPnPContext wraps the networking bits that are used by the various GUPnP classes. It automatically starts a web server on demand.
For debugging, it is possible to see the messages being sent and received by
exporting
typedef struct _GUPnPContext GUPnPContext;
This struct contains private data only, and should be accessed using the functions below.
GUPnPContext* gupnp_context_new (GMainContext *main_context, constchar *host_ip,guint port,GError **error);
Create a new GUPnPContext with the specified main_context
, host_ip
and port
.
|
A |
|
The local host's IP address, or NULL to use the IP address of the first non-loopback network interface. |
|
Port to run on, or 0 if you don't care what port is used. |
|
A location to store a NULL |
Returns : |
A new GUPnPContext object, or NULL |
constchar * gupnp_context_get_host_ip (GUPnPContext *context);
Get the IP address we advertise ourselves as using.
|
A GUPnPContext |
Returns : |
The IP address. This string should not be freed. |
guint gupnp_context_get_port (GUPnPContext *context);
Get the port that the SOAP server is running on.
|
A GUPnPContext |
Returns : |
The port the SOAP server is running on. |
SoupServer * gupnp_context_get_server (GUPnPContext *context);
Get the
|
A GUPnPContext |
Returns : |
The |
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.
|
A GUPnPContext |
|
Event subscription timeout in seconds |
guint gupnp_context_get_subscription_timeout (GUPnPContext *context);
Get the event subscription timeout (in seconds), or 0 meaning there is no timeout.
|
A GUPnPContext |
Returns : |
The event subscription timeout in seconds. |
void gupnp_context_host_path (GUPnPContext *context, constchar *local_path, constchar *server_path);
Start hosting local_path
at server_path
. Files with the path
local_path.LOCALE
(if they exist) will be served up when LOCALE is
specified in the request's Accept-Language header.
|
A GUPnPContext |
|
Path to the local file or folder to be hosted |
|
Web server path where local_path should be hosted
|
void gupnp_context_unhost_path (GUPnPContext *context, constchar *server_path);
Stop hosting the file or folder at server_path
.
|
A GUPnPContext |
|
Web server path where the file or folder is hosted |
"host-ip"
property"host-ip"gchar * : Read / Write / Construct Only
The local host's IP address. Set to NULL to autodetect.
Default value: NULL
"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