FirstSteps » History » Version 4
Anonymous, 07/24/2011 05:58 PM
Linkfix
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 | 4 | Anonymous | Currently, RSB uses "the Spread group communication framework":http://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 | 3 | 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 | 3 | J. Moringen | Finally, it may be interesting to observe the actual events as they are sent over the network rather than just the output of the receiving process. This can be achieved using the @rsblogger@ tools. |
63 | 3 | J. Moringen | |
64 | 3 | J. Moringen | # Starting the @rsblogger@ Process |
65 | 3 | J. Moringen | <pre> |
66 | 3 | J. Moringen | /RSB_CPP_TOOLS_SOURCE_DIRECTORY/build/logger/rsblogger --format detailed / |
67 | 3 | J. Moringen | </pre> |
68 | 3 | J. Moringen | *Note that the @rsblogger@ program is located in the @cpp/tools@ sub-project, not the @cpp/core@ sub-project.* |
69 | 3 | J. Moringen | # Starting the Informer Process |
70 | 3 | J. Moringen | Once again: |
71 | 3 | J. Moringen | <pre> |
72 | 3 | J. Moringen | $ /RSB_CPP_SOURCE_DIRECTORY/core/build/build/rsb_informer |
73 | 3 | J. Moringen | Elapsed time for 1200 messages sent: 0.06 s |
74 | 3 | J. Moringen | </pre> |
75 | 3 | J. Moringen | |
76 | 3 | J. Moringen | The @rsblogger@ process should display output like the following: |
77 | 3 | J. Moringen | <pre> |
78 | 3 | J. Moringen | Event |
79 | 3 | J. Moringen | Scope /example/informer/ |
80 | 3 | J. Moringen | Id 1b043ce7-0294-45a2-80d3-a43703b63986 |
81 | 3 | J. Moringen | Type std::string |
82 | 3 | J. Moringen | Origin a5c937c8-e796-41ba-9c99-e5f2c4b94894 |
83 | 3 | J. Moringen | Timestamps |
84 | 3 | J. Moringen | Create 2011-Jul-19 11:32:05.425828+??:?? |
85 | 3 | J. Moringen | Send 2011-Jul-19 11:32:05.425835+??:?? |
86 | 3 | J. Moringen | Receive 2011-Jul-19 11:32:05.441087+??:?? |
87 | 3 | J. Moringen | Deliver 2011-Jul-19 11:32:05.441143+??:?? |
88 | 3 | J. Moringen | Payload (std::string, length 4) |
89 | 3 | J. Moringen | blup |
90 | 3 | J. Moringen | </pre> |
91 | 3 | J. Moringen | |
92 | 3 | J. Moringen | Note that it does not matter for this experiment whether there is a receiving process or not. The events will be sent and displayed in any case. |
93 | 1 | J. Moringen | |
94 | 1 | J. Moringen | More information regarding RSB tools can be found on [[Tools|this page]]. |