I have the following code that listens on a port and receives data from the Sigfox cloud via a callback.
The data is parsed, then I need to close or release the HTTP connection in order for Sigfox to acknowledge that the callback has been received.
My Disconnect:
It seems that "Disconnect" is not correct.
How do I successfully disconnect or release the HPPT connection?
The data is parsed, then I need to close or release the HTTP connection in order for Sigfox to acknowledge that the callback has been received.
B4X:
Sub AStream_NewData (Buffer() As Byte)
Dim MyStr As String
MyStr = BytesToString(Buffer,0,Buffer.Length,"UTF-8")
MyStr = MyStr.Trim
Dim strJSON As String
Dim pos1 As Int
Dim pos2 As Int
pos1 = MyStr.IndexOf("{")
pos2 = MyStr.LastIndexOf("}")
strJSON=MyStr.SubString2(pos1,(pos2 + 1))
Dim parser As JSONParser
parser.Initialize(strJSON)
Dim root As Map = parser.NextObject
Dim data As String = root.Get("data")
Dim device As String = root.Get("device")
Log(data)
Log(device)
' Close Connection
Disconnect
End Sub
My Disconnect:
B4X:
Private Sub Disconnect
CloseExistingConnection
End Sub
It seems that "Disconnect" is not correct.
How do I successfully disconnect or release the HPPT connection?
Last edited: