Read time data from server fast without new connection by tcpclient
Ältere Kommentare anzeigen
Hello everyone,
I would like to get the current time from a website, similar to the answer in
https://de.mathworks.com/matlabcentral/answers/477336-how-can-i-get-date-and-time-from-nist-server, where the following was described:
Nist_Time = tcpclient('time.nist.gov',13);
tcpdata = read(Nist_Time);
The read command works fine for the first time, but if I try
tcpdata = read(Nist_Time);
again, only
[]
is returned. I suspect that the connection to the server is gone after the first call, but I don't know how to maintain it.
I look forward to your feedback!
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu TCP/IP Communication finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!