Designing Daytime Peer

FtpView demonstrates general networking concepts such as connecting to the network and host resolution, as well as exploring TCP connections in depth. The other major Internet transport protocol is the User Datagram Protocol, or UDP. UDP is a lighter-weight, less reliable protocol than TCP.

We will explore the User Datagram Protocol with Daytime 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 it supplies.

Functional Analysis

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 supplier separately.

Daytime consumer

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 Daytime Peer consumer.

Daytime consumer application flow

Figure 3-8. Daytime consumer application ...

Get Palm OS Network Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.