通过 TCP 使用
通过 TCP 使用时,时间服务的工作方式如下:
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.
服务器在端口 37 上监听连接。连接建立后,服务器返回一个 32 位时间值并关闭连接。如果服务器无法确定其站点的时间,则应拒绝连接,或在不发送任何内容的情况下关闭连接。