FirstSteps » History » Version 2

J. Moringen, 07/19/2011 11:27 AM
added informer/listener experiment

1 1 J. Moringen
h1. First Steps
2 1 J. Moringen
3 1 J. Moringen
h2. Introduction
4 1 J. Moringen
5 1 J. Moringen
After having installed RSB, trying some of the included example programs and generally making sure everything works as it should may be a good next step. This page describes some initial experiments that can be carried out after installing RSB.
6 1 J. Moringen
7 1 J. Moringen
h2. Starting RSB Programs
8 1 J. Moringen
9 1 J. Moringen
Currently, RSB uses "the Spread group communication framework":www.spread.org as its default network transport. Spread requires a dedicated daemon process to be running on at least one host of the network segment. Installation of the Spread libraries and daemon is explained on the [[Installation|installation page]].
10 1 J. Moringen
11 1 J. Moringen
# Starting the Spread daemon
12 1 J. Moringen
If only a single machine is involved, the Spread daemon can be started using the following command:
13 1 J. Moringen
<pre>
14 1 J. Moringen
$ /SPREAD_INSTALL_PREFIX/sbin/spread -n localhost
15 1 J. Moringen
/===========================================================================\
16 1 J. Moringen
| The Spread Toolkit.                                                       |
17 1 J. Moringen
| Copyright (c) 1993-2006 Spread Concepts LLC                               |
18 1 J. Moringen
| All rights reserved.                                                      |
19 1 J. Moringen
[...]
20 1 J. Moringen
</pre>
21 1 J. Moringen
# Starting an RSB Example Program
22 1 J. Moringen
After the Spread is running, connecting to it can be tested using one the example programs. For instance:
23 1 J. Moringen
<pre>
24 1 J. Moringen
$ /RSB_CPP_SOURCE_DIRECTORY/core/build/build/rsb_informer
25 1 J. Moringen
Elapsed time for 1200 messages sent: 0.06 s
26 1 J. Moringen
</pre>
27 1 J. Moringen
If everything goes well, the output should look similar to the above. If the connection to the Spread daemon fails, the output will look similar to the following:
28 1 J. Moringen
<pre>
29 1 J. Moringen
$ /RSB_CPP_SOURCE_DIRECTORY/core/build/build/rsb_informer
30 1 J. Moringen
1311067154364 rsb.spread.SpreadConnection [FATAL]: spread connect error: connection to spread daemon failed due to socket errors
31 1 J. Moringen
SP_error: (-2) Could not connect. Is Spread running?
32 1 J. Moringen
terminate called after throwing an instance of 'rsb::CommException'
33 1 J. Moringen
  what():  Error during connection to spread daemon
34 1 J. Moringen
Aborted
35 1 J. Moringen
</pre>
36 1 J. Moringen
37 1 J. Moringen
h2. Exchanging Events between two Processes
38 1 J. Moringen
39 2 J. Moringen
A more interesting experiment can be conducted by adding a receiving process. The easiest way to do this is using one shell for each process.
40 2 J. Moringen
41 2 J. Moringen
# Starting the Receiving Process
42 2 J. Moringen
<pre>
43 2 J. Moringen
$ /RSB_CPP_SOURCE_DIRECTORY/core/build/build/rsb_listener
44 2 J. Moringen
Listener setup finished. Waiting for messages on scope Scope[/example/informer/]
45 2 J. Moringen
</pre>
46 2 J. Moringen
# Starting the Informer Process
47 2 J. Moringen
Like before
48 2 J. Moringen
<pre>
49 2 J. Moringen
$ /RSB_CPP_SOURCE_DIRECTORY/core/build/build/rsb_informer
50 2 J. Moringen
Elapsed time for 1200 messages sent: 0.06 s
51 2 J. Moringen
</pre>
52 2 J. Moringen
53 2 J. Moringen
The @rsb_listener@ process should start to print lots of messages like
54 2 J. Moringen
<pre>
55 2 J. Moringen
blub
56 2 J. Moringen
blub
57 2 J. Moringen
[...]
58 2 J. Moringen
</pre>
59 1 J. Moringen
60 1 J. Moringen
h2. Observing Events using the @rsblogger@ Program
61 1 J. Moringen
62 1 J. Moringen
TBD
63 1 J. Moringen
64 1 J. Moringen
More information regarding RSB tools can be found on [[Tools|this page]].