Galaxy Communicator Documentation:

Brokering example

License / Documentation home / Help and feedback

In this example, we demonstrate the basic principles of brokering, including multiple broker clients and environment-aware brokers.

This example can be found in the distribution in contrib/MITRE/examples/audio.

All examples use /dev/audio for output, so they will only play the audio on platforms which support that device.

Source fiiles

testaudio_send.c: sets up an outgoing broker for 8-bit audio data. Provides options for all types of brokering, including broker proxies and streaming.

testaudio_receive.c: sets up an incoming broker for 8-bit audio in response to a Hub message. Provides options for all sorts of brokering, including using environments, proxies and streaming. Dumps the result to the audio device and writes a notification message to the Hub.

testaudio_abort_send.c: terminates a broker without completing it appropriately. This server triggers the broker abort behavior in the receiving servers.

Running the example

All configurations in this example can be accessed by invoking the process monitor, as follows.
Unix

% cd <root_of_GC>
% ./contrib/MITRE/tools/bin/process_monitor contrib/MITRE/examples/audio/audio.config

Windows

C:\> set GC_HOME=<root_of_GC>
C:\> python %GC_HOME%\
contrib\MITRE\tools\src\process_monitor\process_monitor.py %GC_HOME%\contrib\MITRE\examples\audio\audio.config
In addition, on Unix, we generate the following scripts.

audio.csh: runs the testaudio_send and testaudio_receive servers and the Hub, using the audio.pgm program file.

env_audio.csh: runs the testaudio_send and testaudio_receive servers and the Hub, using the env_audio.pgm program file. Note that the Hub receives a session ID along with the notification message at the end of the interaction, in contrast to the audio.csh example.

double_audio.csh: runs the testaudio_send server, two testaudio_receive servers, and the Hub, using the double_audio.pgm program file. Observe that both broker clients receive the same audio.

client_double_audio.csh: like double_audio.csh, except that the testaudio_send server is started up as a Hub client. Start this server last.

Language bindings

The python/ subdirectory contains a Python version of the testaudio_send and testaudio_receive servers. These servers are completely interchangeable with the C versions. In order to play with it, you can substitute it into the scripts.

The acl/ subdirectory contains an Allegro Common Lisp version of the testaudio_send and testaudio_receive  servers. These servers are completely interchangeable with the C versions. In order to play with them, you can substitute it into the scripts.

The java/ subdirectory contains a Java version of the testaudio_send and testaudio_receive servers. These servers are completely interchangeable with the C version. In order to play with it, you can substitute them into the scripts.

Compilation

On Unix, typing "make" in this directory will create the servers, MIT-style Makefiles, scripts and Python, Java and Allegro Common Lisp servers.

The C version of this server contains a MSVC workspace for Windows, which is also included in the toplevel MSVC workspace for the Galaxy Communicator distribution.

Discussion

See the documentation on audio and brokering, as well as the session management documentation.


License / Documentation home / Help and feedback
Last updated August 8, 2002