Next: Server Classes
Up: Common Components
Previous: NetMeasure
  Contents
Within the gossip server and client, connection classes
encapsulate all the network functions of the program. They are
responsible for initiating physical connections to other hosts,
handling incoming connections, sending and receiving
messages and handing off the incoming data to the correct module of
the program (e.g. NetMeasure for an addServer
message). GossipConnection is the abstract class which contains the
functions common to all connections such as receiving
and parsing incoming messages and sending messages over the network.
As can be seen in appendex B.2, GossipConnection has two constructors, one for initiating a connection
and one for receiving a connection. The network code in the project
makes use of the procedures connectsock() and
passivesock() from [CS96]. These functions are used to
connect to another host and create a socket that listens for incoming
connections respectively and have been modified to handle errors using
exceptions rather than terminating.
Nathan Dimmock
2001-06-20