I try to check the connection, by connecting to a host by the function ConnectHost. But if I do so, the ESP8266 memory is getting smaller and smaller... Is this a memory leak in the implementation or my mistake? Do I do anything wrong?
Addition:
The "Stack" is the AvailableRAM. And after a while this available RAM is growing up. I don't know what happens, but maybe the sketch is running without a crash anyway.
Addition:
The "Stack" is the AvailableRAM. And after a while this available RAM is growing up. I don't know what happens, but maybe the sketch is running without a crash anyway.
B4X:
Private Sub isConnected() As Boolean
Dim isCon As Boolean
Dim wifiSocket As WiFiSocket
isCon = wifi.IsConnected
If Not(isCon) Then
Return False
End If
Delay(100)
isCon = wifiSocket.ConnectHost("example.com",80)
If isCon Then
wifiSocket.Close
End If
wifiSocket = Null
Return(isCon)
End Sub
B4X:
AppStart
Connected 1, AP: 1, Stack: 43872
Connected 1, AP: 1, Stack: 43544
Connected 1, AP: 1, Stack: 43216
Connected 1, AP: 1, Stack: 42888
Connected 1, AP: 1, Stack: 42560
Connected 1, AP: 1, Stack: 42232
Connected 1, AP: 1, Stack: 43768
Connected 1, AP: 1, Stack: 43872
Connected 1, AP: 1, Stack: 43544
Connected 1, AP: 1, Stack: 43216
Connected 1, AP: 1, Stack: 42888
Connected 1, AP: 1, Stack: 42560
Connected 1, AP: 1, Stack: 42232
Connected 1, AP: 1, Stack: 41904
Connected 1, AP: 1, Stack: 41576
Connected 1, AP: 1, Stack: 41248
Connected 1, AP: 1, Stack: 40920
Connected 1, AP: 1, Stack: 40592
Connected 1, AP: 1, Stack: 40264
Connected 1, AP: 1, Stack: 39936
Connected 1, AP: 1, Stack: 39608
Connected 1, AP: 1, Stack: 39280
Connected 1, AP: 1, Stack: 38952
Connected 1, AP: 1, Stack: 38624
etc...
Last edited: