Read time data from server fast without new connection by tcpclient
Show older comments
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!
Accepted Answer
More Answers (0)
Categories
Find more on Downloads in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!