File: server-internals.xml

package info (click to toggle)
libdmapsharing 3.9.13-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,340 kB
  • sloc: ansic: 17,285; sh: 4,782; xml: 556; makefile: 459
file content (63 lines) | stat: -rw-r--r-- 2,608 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
               "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
]>
<refentry id="server-internals">
	<refmeta>
		<refentrytitle>Libdmapsharing Server Internals</refentrytitle>
		<manvolnum>3</manvolnum>
		<refmiscinfo>Libdmapsharing</refmiscinfo>
	</refmeta>

	<refnamediv>
		<refname>Libdmapsharing Server Internals</refname>
		<refpurpose>
			Description of libdmapsharing's internal server code
		</refpurpose>
	</refnamediv>

	<refsect1>
		<title>Libdmapsharing Server Internals</title>
		<para>
This description uses DmapAvShare to describe the libdmapsharing internals.
DmapAvShare resembles each implmentation of
the abstract class DMAPShare, including its cousin DmapImageShare. 
After creating a new DmapAvShare, an application should call the object's
dmap_share_serve and dmap_share_publish methods.
The former method starts a new web server by calling
soup_server_new, and it adds callbacks to the SoupServer object to handle
the various paths required by the DMAP specification (/server-info,
/content-codes, /login, and so on). DmapAvShare implements these callbacks,
and DmapShare wraps them in an adapter method to make them suitable
for the SoupServer's requirements.
(Note that some callbacks are common to all DMAP protocols
and are implemented in DMAPShare; e.g., the login callback.) The latter
method, dmap_share_publish, starts the mDNS subsystem. It does
this by using the mDNS implmentation option choosen at compile-time
(either Avahi, DNS-SD, or Howl).

		</para>
		<para>
The DmapStructure class represents the data
which makes up a DMAP request or response. The _cc_defs array defines the
allowed entries in a DmapStructure representation. Likewise,
the numeric content code used by each node is defined by the enum
DmapContentCode. Both the _cc_defs array and the DmapContentCode enum
must be in the same order. That is, if you add an entry to _cc_defs,
then you must add its corresponding content code to DmapContentCode
at the same relative position.

		</para>
		<para>
Assuming DmapStructure defines all the entries you require, DmapAvShare builds
the actual
protocol-specific structures. Note the use of the
function dmap_structure_add. Often, the data dmap_structure_add
adds is provided by a DmapAvRecord object that exists in a DmapDb
object (both interfaces are implemented by the application). Eventually,
the DmapAvShare provides the DmapStructure to the SoupServer object using
the dmap_share_message_set_from_dmap_structure function.

		</para>
	</refsect1>
</refentry>