1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
<title>GUPnPContext</title>
6
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
7
<link rel="start" href="index.html" title="GUPnP Reference Manual">
8
<link rel="up" href="api-utility.html" title="Utility Functions">
9
<link rel="prev" href="api-utility.html" title="Utility Functions">
10
<link rel="next" href="GUPnPResourceFactory.html" title="GUPnPResourceFactory">
11
<meta name="generator" content="GTK-Doc V1.10 (XML mode)">
12
<link rel="stylesheet" href="style.css" type="text/css">
13
<link rel="part" href="tutorial.html" title="Part I. Tutorial">
14
<link rel="chapter" href="overview.html" title="Overview">
15
<link rel="chapter" href="client-tutorial.html" title="Writing a UPnP Client">
16
<link rel="chapter" href="server-tutorial.html" title="Writing a UPnP Service">
17
<link rel="part" href="api.html" title="Part II. Reference">
18
<link rel="chapter" href="api-device-info.html" title="Device Information">
19
<link rel="chapter" href="api-device-control.html" title="Device Control">
20
<link rel="chapter" href="api-device-impl.html" title="Device Implementation">
21
<link rel="chapter" href="api-utility.html" title="Utility Functions">
22
<link rel="chapter" href="api-tools.html" title="Tools">
23
<link rel="part" href="schemas.html" title="Part III. XML Schemas">
24
<link rel="chapter" href="schemas-device.html" title="Device Description">
25
<link rel="chapter" href="schemas-service.html" title="Service Description">
26
<link rel="glossary" href="glossary.html" title="Glossary">
27
<link rel="index" href="ix01.html" title="Index">
29
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
30
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
32
<td><a accesskey="p" href="api-utility.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
33
<td><a accesskey="u" href="api-utility.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
34
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
35
<th width="100%" align="center">GUPnP Reference Manual</th>
36
<td><a accesskey="n" href="GUPnPResourceFactory.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
38
<tr><td colspan="5" class="shortcuts"><nobr><a href="#GUPnPContext.synopsis" class="shortcut">Top</a>
40
<a href="#GUPnPContext.description" class="shortcut">Description</a>
42
<a href="#GUPnPContext.object-hierarchy" class="shortcut">Object Hierarchy</a>
44
<a href="#GUPnPContext.properties" class="shortcut">Properties</a></nobr></td></tr>
46
<div class="refentry" lang="en">
47
<a name="GUPnPContext"></a><div class="titlepage"></div>
48
<div class="refnamediv"><table width="100%"><tr>
50
<h2><span class="refentrytitle"><a name="GUPnPContext.top_of_page"></a>GUPnPContext</span></h2>
51
<p>GUPnPContext — Context object wrapping shared networking bits.</p>
53
<td valign="top" align="right"></td>
55
<div class="refsynopsisdiv">
56
<a name="GUPnPContext.synopsis"></a><h2>Synopsis</h2>
57
<pre class="synopsis">
58
<a class="link" href="GUPnPContext.html#GUPnPContext-struct" title="GUPnPContext">GUPnPContext</a>;
59
<a class="link" href="GUPnPContext.html" title="GUPnPContext">GUPnPContext</a>* <a class="link" href="GUPnPContext.html#gupnp-context-new" title="gupnp_context_new ()">gupnp_context_new</a> (GMainContext *main_context,
63
const char* <a class="link" href="GUPnPContext.html#gupnp-context-get-host-ip" title="gupnp_context_get_host_ip ()">gupnp_context_get_host_ip</a> (<a class="link" href="GUPnPContext.html" title="GUPnPContext">GUPnPContext</a> *context);
64
guint <a class="link" href="GUPnPContext.html#gupnp-context-get-port" title="gupnp_context_get_port ()">gupnp_context_get_port</a> (<a class="link" href="GUPnPContext.html" title="GUPnPContext">GUPnPContext</a> *context);
66
href="/usr/share/gtk-doc/html/libsoup-2.4/SoupServer.html"
67
>SoupServer</a>* <a class="link" href="GUPnPContext.html#gupnp-context-get-server" title="gupnp_context_get_server ()">gupnp_context_get_server</a> (<a class="link" href="GUPnPContext.html" title="GUPnPContext">GUPnPContext</a> *context);
68
void <a class="link" href="GUPnPContext.html#gupnp-context-set-subscription-timeout" title="gupnp_context_set_subscription_timeout ()">gupnp_context_set_subscription_timeout</a>
69
(<a class="link" href="GUPnPContext.html" title="GUPnPContext">GUPnPContext</a> *context,
71
guint <a class="link" href="GUPnPContext.html#gupnp-context-get-subscription-timeout" title="gupnp_context_get_subscription_timeout ()">gupnp_context_get_subscription_timeout</a>
72
(<a class="link" href="GUPnPContext.html" title="GUPnPContext">GUPnPContext</a> *context);
73
void <a class="link" href="GUPnPContext.html#gupnp-context-host-path" title="gupnp_context_host_path ()">gupnp_context_host_path</a> (<a class="link" href="GUPnPContext.html" title="GUPnPContext">GUPnPContext</a> *context,
74
const char *local_path,
75
const char *server_path);
76
void <a class="link" href="GUPnPContext.html#gupnp-context-unhost-path" title="gupnp_context_unhost_path ()">gupnp_context_unhost_path</a> (<a class="link" href="GUPnPContext.html" title="GUPnPContext">GUPnPContext</a> *context,
77
const char *server_path);
80
<div class="refsect1" lang="en">
81
<a name="GUPnPContext.object-hierarchy"></a><h2>Object Hierarchy</h2>
82
<pre class="synopsis">
85
href="../gssdp/GSSDPClient.html"
90
<div class="refsect1" lang="en">
91
<a name="GUPnPContext.properties"></a><h2>Properties</h2>
92
<pre class="synopsis">
93
"<a class="link" href="GUPnPContext.html#GUPnPContext--host-ip" title='The "host-ip" property'>host-ip</a>" gchar* : Read / Write / Construct Only
94
"<a class="link" href="GUPnPContext.html#GUPnPContext--port" title='The "port" property'>port</a>" guint : Read / Write / Construct Only
95
"<a class="link" href="GUPnPContext.html#GUPnPContext--server" title='The "server" property'>server</a>" <a
96
href="/usr/share/gtk-doc/html/libsoup-2.4/SoupServer.html"
97
>SoupServer</a>* : Read
98
"<a class="link" href="GUPnPContext.html#GUPnPContext--subscription-timeout" title='The "subscription-timeout" property'>subscription-timeout</a>" guint : Read / Write / Construct Only
101
<div class="refsect1" lang="en">
102
<a name="GUPnPContext.description"></a><h2>Description</h2>
104
<a class="link" href="GUPnPContext.html" title="GUPnPContext"><span class="type">GUPnPContext</span></a> wraps the networking bits that are used by the various
105
GUPnP classes. It automatically starts a web server on demand.
108
For debugging, it is possible to see the messages being sent and received by
109
exporting <span class="type">GUPNP_DEBUG</span>.</p>
114
<div class="refsect1" lang="en">
115
<a name="GUPnPContext.details"></a><h2>Details</h2>
116
<div class="refsect2" lang="en">
117
<a name="GUPnPContext-struct"></a><h3>GUPnPContext</h3>
118
<pre class="programlisting">typedef struct _GUPnPContext GUPnPContext;</pre>
120
This struct contains private data only, and should be accessed using the
127
<div class="refsect2" lang="en">
128
<a name="gupnp-context-new"></a><h3>gupnp_context_new ()</h3>
129
<pre class="programlisting"><a class="link" href="GUPnPContext.html" title="GUPnPContext">GUPnPContext</a>* gupnp_context_new (GMainContext *main_context,
132
GError **error);</pre>
134
Create a new <a class="link" href="GUPnPContext.html" title="GUPnPContext"><span class="type">GUPnPContext</span></a> with the specified <em class="parameter"><code>main_context</code></em>, <em class="parameter"><code>host_ip</code></em> and <em class="parameter"><code>port</code></em>.</p>
138
<div class="variablelist"><table border="0">
139
<col align="left" valign="top">
142
<td><p><span class="term"><em class="parameter"><code>main_context</code></em> :</span></p></td>
143
<td> A <span class="type">GMainContext</span>, or <code class="literal">NULL</code> to use the default one
147
<td><p><span class="term"><em class="parameter"><code>host_ip</code></em> :</span></p></td>
148
<td> The local host's IP address, or <code class="literal">NULL</code> to use the IP address
149
of the first non-loopback network interface.
153
<td><p><span class="term"><em class="parameter"><code>port</code></em> :</span></p></td>
154
<td> Port to run on, or 0 if you don't care what port is used.
158
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
159
<td> A location to store a <span class="type">GError</span>, or <code class="literal">NULL</code>
163
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
164
<td> A new <a class="link" href="GUPnPContext.html" title="GUPnPContext"><span class="type">GUPnPContext</span></a> object, or <code class="literal">NULL</code> on an error
171
<div class="refsect2" lang="en">
172
<a name="gupnp-context-get-host-ip"></a><h3>gupnp_context_get_host_ip ()</h3>
173
<pre class="programlisting">const char* gupnp_context_get_host_ip (<a class="link" href="GUPnPContext.html" title="GUPnPContext">GUPnPContext</a> *context);</pre>
175
Get the IP address we advertise ourselves as using.</p>
179
<div class="variablelist"><table border="0">
180
<col align="left" valign="top">
183
<td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
184
<td> A <a class="link" href="GUPnPContext.html" title="GUPnPContext"><span class="type">GUPnPContext</span></a>
188
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
189
<td> The IP address. This string should not be freed.
196
<div class="refsect2" lang="en">
197
<a name="gupnp-context-get-port"></a><h3>gupnp_context_get_port ()</h3>
198
<pre class="programlisting">guint gupnp_context_get_port (<a class="link" href="GUPnPContext.html" title="GUPnPContext">GUPnPContext</a> *context);</pre>
200
Get the port that the SOAP server is running on.</p>
204
<div class="variablelist"><table border="0">
205
<col align="left" valign="top">
208
<td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
209
<td> A <a class="link" href="GUPnPContext.html" title="GUPnPContext"><span class="type">GUPnPContext</span></a>
213
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
214
<td> The port the SOAP server is running on.
221
<div class="refsect2" lang="en">
222
<a name="gupnp-context-get-server"></a><h3>gupnp_context_get_server ()</h3>
223
<pre class="programlisting"><a
224
href="/usr/share/gtk-doc/html/libsoup-2.4/SoupServer.html"
225
>SoupServer</a>* gupnp_context_get_server (<a class="link" href="GUPnPContext.html" title="GUPnPContext">GUPnPContext</a> *context);</pre>
228
href="/usr/share/gtk-doc/html/libsoup-2.4/SoupServer.html"
229
><span class="type">SoupServer</span></a> HTTP server that GUPnP is using.</p>
233
<div class="variablelist"><table border="0">
234
<col align="left" valign="top">
237
<td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
238
<td> A <a class="link" href="GUPnPContext.html" title="GUPnPContext"><span class="type">GUPnPContext</span></a>
242
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
244
href="/usr/share/gtk-doc/html/libsoup-2.4/SoupServer.html"
245
><span class="type">SoupServer</span></a> used by GUPnP. Do not unref this when finished.
252
<div class="refsect2" lang="en">
253
<a name="gupnp-context-set-subscription-timeout"></a><h3>gupnp_context_set_subscription_timeout ()</h3>
254
<pre class="programlisting">void gupnp_context_set_subscription_timeout
255
(<a class="link" href="GUPnPContext.html" title="GUPnPContext">GUPnPContext</a> *context,
256
guint timeout);</pre>
258
Sets the event subscription timeout to <em class="parameter"><code>timeout</code></em>. Use 0 if you don't
259
want subscriptions to time out. Note that any client side subscriptions
260
will automatically be renewed.</p>
264
<div class="variablelist"><table border="0">
265
<col align="left" valign="top">
268
<td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
269
<td> A <a class="link" href="GUPnPContext.html" title="GUPnPContext"><span class="type">GUPnPContext</span></a>
273
<td><p><span class="term"><em class="parameter"><code>timeout</code></em> :</span></p></td>
274
<td> Event subscription timeout in seconds
281
<div class="refsect2" lang="en">
282
<a name="gupnp-context-get-subscription-timeout"></a><h3>gupnp_context_get_subscription_timeout ()</h3>
283
<pre class="programlisting">guint gupnp_context_get_subscription_timeout
284
(<a class="link" href="GUPnPContext.html" title="GUPnPContext">GUPnPContext</a> *context);</pre>
286
Get the event subscription timeout (in seconds), or 0 meaning there is no
291
<div class="variablelist"><table border="0">
292
<col align="left" valign="top">
295
<td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
296
<td> A <a class="link" href="GUPnPContext.html" title="GUPnPContext"><span class="type">GUPnPContext</span></a>
300
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
301
<td> The event subscription timeout in seconds.
308
<div class="refsect2" lang="en">
309
<a name="gupnp-context-host-path"></a><h3>gupnp_context_host_path ()</h3>
310
<pre class="programlisting">void gupnp_context_host_path (<a class="link" href="GUPnPContext.html" title="GUPnPContext">GUPnPContext</a> *context,
311
const char *local_path,
312
const char *server_path);</pre>
314
Start hosting <em class="parameter"><code>local_path</code></em> at <em class="parameter"><code>server_path</code></em>. Files with the path
315
<em class="parameter"><code>local_path.LOCALE</code></em> (if they exist) will be served up when LOCALE is
316
specified in the request's Accept-Language header.</p>
320
<div class="variablelist"><table border="0">
321
<col align="left" valign="top">
324
<td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
325
<td> A <a class="link" href="GUPnPContext.html" title="GUPnPContext"><span class="type">GUPnPContext</span></a>
329
<td><p><span class="term"><em class="parameter"><code>local_path</code></em> :</span></p></td>
330
<td> Path to the local file or folder to be hosted
334
<td><p><span class="term"><em class="parameter"><code>server_path</code></em> :</span></p></td>
335
<td> Web server path where <em class="parameter"><code>local_path</code></em> should be hosted
342
<div class="refsect2" lang="en">
343
<a name="gupnp-context-unhost-path"></a><h3>gupnp_context_unhost_path ()</h3>
344
<pre class="programlisting">void gupnp_context_unhost_path (<a class="link" href="GUPnPContext.html" title="GUPnPContext">GUPnPContext</a> *context,
345
const char *server_path);</pre>
347
Stop hosting the file or folder at <em class="parameter"><code>server_path</code></em>.</p>
351
<div class="variablelist"><table border="0">
352
<col align="left" valign="top">
355
<td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
356
<td> A <a class="link" href="GUPnPContext.html" title="GUPnPContext"><span class="type">GUPnPContext</span></a>
360
<td><p><span class="term"><em class="parameter"><code>server_path</code></em> :</span></p></td>
361
<td> Web server path where the file or folder is hosted
368
<div class="refsect1" lang="en">
369
<a name="GUPnPContext.property-details"></a><h2>Property Details</h2>
370
<div class="refsect2" lang="en">
371
<a name="GUPnPContext--host-ip"></a><h3>The <code class="literal">"host-ip"</code> property</h3>
372
<pre class="programlisting"> "host-ip" gchar* : Read / Write / Construct Only</pre>
374
The local host's IP address. Set to NULL to autodetect.</p>
378
<p>Default value: NULL</p>
381
<div class="refsect2" lang="en">
382
<a name="GUPnPContext--port"></a><h3>The <code class="literal">"port"</code> property</h3>
383
<pre class="programlisting"> "port" guint : Read / Write / Construct Only</pre>
385
The port to run on. Set to 0 if you don't care what port to run on.</p>
389
<p>Default value: 0</p>
392
<div class="refsect2" lang="en">
393
<a name="GUPnPContext--server"></a><h3>The <code class="literal">"server"</code> property</h3>
394
<pre class="programlisting"> "server" <a
395
href="/usr/share/gtk-doc/html/libsoup-2.4/SoupServer.html"
396
>SoupServer</a>* : Read</pre>
399
href="/usr/share/gtk-doc/html/libsoup-2.4/SoupServer.html"
400
><span class="type">SoupServer</span></a> HTTP server used by GUPnP.</p>
406
<div class="refsect2" lang="en">
407
<a name="GUPnPContext--subscription-timeout"></a><h3>The <code class="literal">"subscription-timeout"</code> property</h3>
408
<pre class="programlisting"> "subscription-timeout" guint : Read / Write / Construct Only</pre>
410
The preferred subscription timeout: the number of seconds after
411
which subscriptions are renewed. Set to '0' if subscriptions
412
are never to time out.</p>
416
<p>Allowed values: <= 604800</p>
417
<p>Default value: 1800</p>
423
Generated by GTK-Doc V1.10</div>