4 Writing Host Applications
A host application is an application that lives on an end-node and
communicates with PLAN active nodes via PLAN ports. PLAN ports can be
opened from a host application by opening a connection on the port that the
PLAN router is listening on.2 Also, a PLAN port may be opened from an active
router using the openPort service. Once the connection is
established, it is assumed that all messages going to an active node are
marshalled objects of type active_packet. Messages coming from the
active node are service dependent. For example, the print service
sends strings, while the deliver service sends marshalled objects of
type value. Marshalling is done via the marhsalling module.
All of these classes are present in the PLAN basis directory.
An example host application, called server, can be found in the port directory. It listens for connections on a specified port, and prints
out delivered values. It may be used as a template for your own
applications.
To facilitate the implementation of host applications in Java, we have
written some stub code that facilitates the transmission of PLAN values in
Java. The stubs are present in the java directory; see the README file there for more details.