极速车主信息提取工具:哪位能帮忙根据RFC编写Time程序(UDP和TCP都要,客户与服务器端都要),谢谢!

来源:百度文库 编辑:查人人中国名人网 时间:2024/05/10 12:40:53
RFC说明:
This RFC specifies a standard for the ARPA Internet community. Hosts on the ARPA Internet that choose to implement a Time Protocol are expected to adopt and implement this standard.This protocol provides a site-independent, machine readable date and time. The Time service sends back to the originating source the time in seconds since midnight on January first 1900.One motivation arises from the fact that not all systems have a date/time clock, and all are subject to occasional human or machine error.The use of time-servers makes it possible to quickly confirm or correct a system's idea of the time, by making a brief poll of several independent sites on the network.
S: Listen on port 37 (45 octal).
U: Connect to port 37.
S: Send the time as a 32 bit binary number.
U: Receive the time.
U: Close the connection.
S: Close the connection.
The server listens for a connection on port 37. When the connection is established, the server returns a 32-bit time value and closes the connection. If the server is unable to determine the time at its site, it should either refuse the connection or close it without sending anything.

RFC?看成RPC了~~~~

linux下面有个rdate的程序,看看它的源码吧,符合你的要求