Warning: preg_match(): Delimiter must not be alphanumeric, backslash, or NUL in /var/www/html/activities/books/networking/labbook/exp/exp9.1.php on line 2

Warning: preg_match(): Delimiter must not be alphanumeric, backslash, or NUL in /var/www/html/activities/books/networking/labbook/exp/exp9.1.php on line 2

Warning: preg_match(): Delimiter must not be alphanumeric, backslash, or NUL in /var/www/html/activities/books/networking/labbook/exp/exp9.1.php on line 3

Warning: preg_match(): Delimiter must not be alphanumeric, backslash, or NUL in /var/www/html/activities/books/networking/labbook/exp/exp9.1.php on line 4

Warning: preg_match(): Delimiter must not be alphanumeric, backslash, or NUL in /var/www/html/activities/books/networking/labbook/exp/exp9.1.php on line 5

Warning: preg_match(): Delimiter must not be alphanumeric, backslash, or NUL in /var/www/html/activities/books/networking/labbook/exp/exp9.1.php on line 8

 

 


Douglas E. Comer


Computer Science Department
Purdue University
West Lafayette, IN 47907

webmaster: W. David Laverell


Companion Topics

Home

Book Information

Purpose of Site

Getting Started

Students

Faculty

"What's New"

"Coming Attractions"

"C Pointers"

Acknowledgements

 

 
Hands-On Networking: Experiment 9.1 Home > Student > Experiments > 9.1

Experiment 9.1

Chapter 9
9.1 9.2 9.3
Be sure to consult RFC: 868 for details on what it is that a time server sends you. It is not the same thing as your local time.

The function ctime converts an integer-based time into a string. It automatically handles time-zone information rendering Optional Extension 1 trivial. I will leave it to you to consult the RFC for the simple conversion which you must perform so as to get the correct local time on your machine.

As with many network services, not all hosts provide this service. www.cs.purdue.edu does offer time service.

The layout of the timeval struct can be found in /usr/include/sys/time.h on Solaris machines and in /usr/include/linux/time.h in Redhat Linux (7.2).

If you are working on a Linux box, David Vos suggests setting the SO_RCVTIMEO socket option passing in the address of a timeval struct as the option data. If recvfrom times out, it will return EAGAIN (defined in errno.h. This will not work in Solaris.



This site is maintained by W. David Laverell of the Computer Science Department at Calvin College. For assistance or corrections, please contact him at lave@calvin.edu.