Hi all, i have this code:
in same time work and in another time no.
If i run it always comes to this point '<------- HERE ****** and in some cases does not go on.
What i wrong ?
Thanks
B4X:
Dim list_server As List
list_server.Initialize
list_server.Add("time-a.nist.gov")
list_server.Add("nist1-macon.macon.ga.us")
list_server.Add("nisttime.carsoncity.k12.mi.us")
list_server.Add("nist.netservicesgroup.com")
list_server.Add("time.nist.gov")
list_server.Add("utcnist.colorado.edu")
For i = 0 To list_server.Size -1
socket1.Initialize("socket1")
Log("*****---> " & list_server.Get(i))
socket1.Connect(list_server.Get(i), 13, 20000)
Wait For (socket1) Socket1_Connected (Successful As Boolean)
If (Successful) Then
Log("Connect Successo") '<------- HERE ******
AStreams.Initialize(socket1.InputStream, socket1.OutputStream, "AStreams")
Wait For (AStreams) AStreams_NewData (Buffer() As Byte)
Log("AStreams inizializzata")
Dim msg As String
msg = BytesToString(Buffer, 0, Buffer.Length, "UTF8")
Log("Time: " & msg)
'Msgbox("Time received: " & CRLF & msg, "")
socket1.Close
Else
Log(LastException.Message)
socket1.Close
End If
Next
in same time work and in another time no.
If i run it always comes to this point '<------- HERE ****** and in some cases does not go on.
What i wrong ?
Thanks