Subscriber/Publisher
In this example, the server program implements a simple Publisher
interface and periodically sends Stock Quotes to its subscribers. The client
program implements a Subscriber interface which receives Stock Quotes.
From this example, you will learn how to:
- Perform basic communication using the ORB.
- Use client callbacks.
Directory Contents
- sub.idl
IDL interface to the 'Subscriber' object and the Stock Quote data
structure.
- pub.idl
IDL interface to the 'Publisher' object.
- util.idl
Utility sequence used by the server.
- server.C (server.cpp on Windows)
Implementation of the Publisher interface.
- client.C (client.cpp on Windows)
Implementation of the Subscriber interface.
-
Makefile
Used to build client and server programs.
Building this example
Typing make all (or nmake on Windows) in the subscrip subdirectory will cause the following
executables to be built:
- server (server.exe on Windows)
- client (client.exe on Windows)
Running this example
To run the examples, first make sure that the VisiBroker Smart Agent (osagent
executable) is running on your network. Then start the server using the
command:
prompt> server &
or on Windows:
prompt> start server
Next, run one or more client programs on the same or on different machines:
prompt> client
The client program should periodically display Stock Quotes received.
Return to the top-level examples page.