Hi all,
I am using a fast timer to send sensor telemetry data back to my VB6 server using aSyncStreamtext. However, the data sometimes will all merge (not always).
TimerSvc1.Initialize ("TimerSvc1",50)
Dim mymessage As String
DateTime.DateFormat = "dd/MMM/yyyy HH:mm:ss"
dt = DateTime.Date(DateTime.now)
mymessage = "$$" & "@" & Round2(SensorData,2) & "@" & dt & "!#" & CRLF
If Socket1.Connected = True Then
TCPFlusso.Write (mymessage)
End if
Several mymessage will be sent together.
I tried the
https://www.b4x.com/android/forum/threads/asyncstream-and-flush.146655/ to flush the buffer and force send a single mymessage but it does not seem to work (same behaviour as the code above).
Dim mymessage As String
DateTime.DateFormat = "dd/MMM/yyyy HH:mm:ss"
dt = DateTime.Date(DateTime.now)
mymessage = "$$" & "@" & Round2(SensorData,2) & "@" & & dt & "!#" & CRLF
If Socket1.Connected = True Then
r.Target=TCPFlusso
r.Target=r.GetField("aout")
aout=r.GetField("out")
TCPFlusso.Write2 (mymessage.GetBytes("UTF8"),0,mymessage.Length)
aout.RunMethod("flush",Null) ' force send
End if
I am using just regular Winsock in my VB6 server to receive the data.
Any ideas on how to solve this problem?
Thanks.