need help sending upd to nist
Posted: Mon Mar 20, 2017 1:41 pm
I'm attempting to get a message back from nist in daytime protocol. I don't really know if this is possible with the current system, but I thought I'd give it a try.
Using the following code, I never receive a response, so either I'm misunderstanding how to do udp or something else is incorrect.
Any help will be appreciated.
edit: fixed misspelling of udpremote
Using the following code, I never receive a response, so either I'm misunderstanding how to do udp or something else is incorrect.
Code: Select all
' attempt to get daytime protocol string from nist
memclear
cls
button "quit",[quit]
wprint "<br>"
wprint "setting port<br>"
returngui
udpbegin 13 ' port for upd daytime protocol
wprint "setting branch<br>"
returngui
udpbranch [msgin]
wprint "sending message<br>"
returngui
' attempt to get daytime protocol message from nist
udpwrite "time.nist.gov", 13, "?"
wprint "waiting for message<br>"
wait
[msgin]
wprint "got message<br>"
wprint udpread() & " from " & udpremote()
udpstop ' release port
return
[quit]
end
Any help will be appreciated.
edit: fixed misspelling of udpremote