FirstSteps » History » Version 7
« Previous -
Version 7/8
(diff) -
Next » -
Current version
Anonymous, 10/18/2011 10:40 AM
First Steps¶
Introduction¶
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.
Starting RSB Programs¶
Currently, RSB uses the Spread group communication framework 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 page.
- Starting the Spread daemon
If only a single machine is involved, the Spread daemon can be started using the following command:$ /SPREAD_INSTALL_PREFIX/sbin/spread -n localhost /===========================================================================\ | The Spread Toolkit. | | Copyright (c) 1993-2006 Spread Concepts LLC | | All rights reserved. | [...]
- Starting an RSB Example Program
After the Spread daemon is running, connecting to it can be tested using one the example programs. For instance:$ /RSB_CPP_SOURCE_DIRECTORY/core/build/build/rsb_informer Elapsed time for 1200 messages sent: 0.06 s
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:$ /RSB_CPP_SOURCE_DIRECTORY/core/build/build/rsb_informer 1311067154364 rsb.spread.SpreadConnection [FATAL]: spread connect error: connection to spread daemon failed due to socket errors SP_error: (-2) Could not connect. Is Spread running? terminate called after throwing an instance of 'rsb::CommException' what(): Error during connection to spread daemon Aborted
Exchanging Events between two Processes¶
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.
- Starting the Receiving Process
$ /RSB_CPP_SOURCE_DIRECTORY/core/build/build/rsb_listener Listener setup finished. Waiting for messages on scope Scope[/example/informer/]
- Starting the Informer Process
Like before:$ /RSB_CPP_SOURCE_DIRECTORY/core/build/build/rsb_informer Elapsed time for 1200 messages sent: 0.06 s
The rsb_listener
process should start to print lots of messages like
blub blub [...]
Observing Events using the rsblogger Program¶
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.
- Starting the
rsblogger
Process/RSB_CPP_TOOLS_SOURCE_DIRECTORY/build/logger/rsblogger --format detailed /
Note that thersblogger
program is located in thecpp/tools
sub-project, not thecpp/core
sub-project. - Starting the Informer Process
Once again:$ /RSB_CPP_SOURCE_DIRECTORY/core/build/build/rsb_informer Elapsed time for 1200 messages sent: 0.06 s
The rsblogger
process should display output like the following:
Event Scope /example/informer/ Id 1b043ce7-0294-45a2-80d3-a43703b63986 Type std::string Origin a5c937c8-e796-41ba-9c99-e5f2c4b94894 Timestamps Create 2011-Jul-19 11:32:05.425828+??:?? Send 2011-Jul-19 11:32:05.425835+??:?? Receive 2011-Jul-19 11:32:05.441087+??:?? Deliver 2011-Jul-19 11:32:05.441143+??:?? Payload (std::string, length 4) blup
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.
More information regarding RSB tools can be found on this page.