Java HTTP client getting time from NTP server [duplicate]
Solution 1:
TCP (and UDP) port 37, which you are connecting to, is used for the TIME
protocol (RFC 868). In this protocol, times are sent as a single binary 32bit integer in network byte order.
UDP port 123 is used for the NTP
protocol (RFCs 1059, 1119, 1305, 5905). In this protocol, times are sent as a series of binary messages.
You can't read either type of data as text with BufferedReader.ReadLine()
.