Debugging features

Running the sample program

The distribution comes with a sample OttoBus debugging implementation in file

The debugging application can then be launched like this:

The above example will startup with a 640 by 480 application window (no window dimensions were specified) If another initial size is desired, just specify the desired width and height as additional parameters. This example will create a window of 800 by 600 pixels:

In contrast to the sample application, the debugging tool does not listen to any other subject than the one used by the OttoBus debygging features. The initial screen looks something like this:

The top half of the window is used for user input, the lower half is used for output. In this picture, the debugger interface received one message from an instance of test_awt.

With the "Send" button, the application can be used to send normal messages to listeners on the specified subject, just like the sample applicaion test_awt.

The other two buttons are for debugging purposes.

The button labeled "To debug clients" can be used to send a message to the debugging clients only (in that case, the "Subject" interface fields are ignored)

The only debug commands currently available are for the OttoBusLogger class:

Note that these commands are to be sent using one of the two string formats (either 7-bit or 8-bit ASCII) and that they are case sensitive.

The last button, labeled "Foefel!" (in my own language, Dutch, this the word for a well known debugging technique) This feature is mainly intended for testing the fragmentation code in OttoBus. Before using it, you might want to consider lowering the maximum fragment length in class OttoBusFragment to something much smaller (e.g. use a value of 10 or 15)

So, if you want to test fragmenting, enter the entire message to send in the main panel and click on the button labeled "Foefel!" A screen somewhat like this will appear:

The top half contains the list of fragments to send for the message entered in the main panel. In order to send a fragment, click it, followed by a cick on the "Send" button. The selected message will disappear from the list of fragments waiting to be transmitted. Repeat for sending another fragment.

This interface allows to send fragments out of order, as well as omitting to send fragments within the expected timeout. The default timeout is 10 seconds (which can be configured in the source of OttoBusReceiver where 5 rounds of 2 seconds each are the default timeout period)


The source code of this sample debugging application is not meant to serve as an example for normal OttoBus applications since it relies too heavy on inside knowledge of the library.

OttoBus home

Last Update: 16 September 2001