O'Reilly logo

Palm OS Network Programming by Greg Winton

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required