1. Basic XML configurationΒΆ
This example creates a server and two clients of this server. Each of the clients has a publisher and a subscriber on two different topics. In addition, a snapshot of the discovery table status is launched in the second five of execution.
1<?xml version="1.0" encoding="utf-8"?>
2<DS xmlns="http://www.eprosima.com/XMLSchemas/discovery-server" user_shutdown="false">
3
4 <servers>
5 <server name="server" profile_name="UDP server" />
6 </servers>
7
8 <clients>
9 <client name="client1" profile_name="UDP_client1_server1">
10 <publisher topic="topic1"/>
11 <subscriber topic="topic2"/>
12 </client>
13 <client name="client2" profile_name="UDP_client2_server1">
14 <subscriber topic="topic1"/>
15 <publisher topic="topic2"/>
16 </client>
17 </clients>
18
19 <snapshots file="test_01_trivial.snapshot">
20 <snapshot time="5">test_01_trivial_snapshot_1</snapshot>
21 </snapshots>
22
23 <profiles>
24 <participant profile_name="UDP_client1_server1" >
25 <rtps>
26 <prefix>63.6c.69.65.6e.74.31.5f.73.31.5f.5f</prefix>
27 <builtin>
28 <discovery_config>
29 <discoveryProtocol>CLIENT</discoveryProtocol>
30 <discoveryServersList>
31 <RemoteServer prefix="44.49.53.43.53.45.52.56.45.52.5F.31">
32 <metatrafficUnicastLocatorList>
33 <locator>
34 <udpv4>
35 <address>127.0.0.1</address>
36 <port>01811</port>
37 </udpv4>
38 </locator>
39 </metatrafficUnicastLocatorList>
40 </RemoteServer>
41 </discoveryServersList>
42 </discovery_config>
43 </builtin>
44 </rtps>
45 </participant>
46
47 <participant profile_name="UDP_client2_server1" >
48 <rtps>
49 <prefix>63.6c.69.65.6e.74.32.5f.73.31.5f.5f</prefix>
50 <builtin>
51 <discovery_config>
52 <discoveryProtocol>CLIENT</discoveryProtocol>
53 <discoveryServersList>
54 <RemoteServer prefix="44.49.53.43.53.45.52.56.45.52.5F.31">
55 <metatrafficUnicastLocatorList>
56 <locator>
57 <udpv4>
58 <address>127.0.0.1</address>
59 <port>01811</port>
60 </udpv4>
61 </locator>
62 </metatrafficUnicastLocatorList>
63 </RemoteServer>
64 </discoveryServersList>
65 </discovery_config>
66 </builtin>
67 </rtps>
68 </participant>
69
70 <participant profile_name="UDP server">
71 <rtps>
72 <prefix>44.49.53.43.53.45.52.56.45.52.5F.31</prefix>
73 <builtin>
74 <discovery_config>
75 <discoveryProtocol>SERVER</discoveryProtocol>
76 </discovery_config>
77 <metatrafficUnicastLocatorList>
78 <locator>
79 <udpv4>
80 <address>127.0.0.1</address>
81 <port>01811</port>
82 </udpv4>
83 </locator>
84 </metatrafficUnicastLocatorList>
85 </builtin>
86 </rtps>
87 </participant>
88
89 <topic profile_name="topic1">
90 <name>topic_1</name>
91 <dataType>HelloWorld</dataType>
92 </topic>
93
94 <topic profile_name="topic2">
95 <name>topic_2</name>
96 <dataType>HelloWorld</dataType>
97 </topic>
98
99 </profiles>
100</DS>