A Time of Day Client

We'll start our discussion with udp_daytime_cli.pl, a UDP-based network client for the daytime service. As you might recall from Chapters 1 and 3, the TCP-based daytime service waits for an incoming connection and responds with a single CRLF-delimited line that contains the time and date at the server's machine. The UDP version of the daytime service is similar, but behaves slightly differently because it's a datagram-based service. Instead of waiting for incoming connections, the UDP service waits for incoming datagrams. When it receives a datagram, it examines the sender's address and then transmits to this address a return datagram that contains the current time and date. No connection is involved.

Our client takes up ...

Get Network Programming with Perl now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.