Designing Daytime Peer
FtpView demonstrates general networking
such as connecting to the network and
host resolution, as well as exploring TCP connections in depth. The
other major Internet transport
the User Datagram Protocol, or UDP. UDP is a lighter-weight, less
reliable protocol than TCP.
We will explore the User Datagram Protocol with
Peer, a Daytime Protocol peer application. The Daytime
Protocol allows hosts to request the current date and time service
from other hosts. We refer to the host that requests the service as
the consumers and the host that provides the service as the supplier.
Daytime Peer acts as both consumer and supplier.
In the default configuration, it consumes the same time service that
Daytime Peer is a much simpler application than
FtpView, even though we provide both a consumer
and a supplier component. At program startup, the application is
configured to communicate with itself, mostly for purposes of
illustration. The user is free to select a different time server and
receive the time from it. We will examine the Daytime consumer and
A Daytime consumer sends requests for
the Daytime service to Daytime suppliers, and receives the
supplier’s response. Figure 3-8 illustrates
the application flow of the
Figure 3-8. Daytime consumer application ...