- Mon Mar 20, 2017 2:30 am
#63988
marcelstoer, Thank you for the time and effort you put into solving this.
Short version: It works!
Long version: When you originally modified my test code, you removed the conn:close() which caused it to hang (Firefox timeout as you explained). jankop experienced the same issue, so he modified your version to close the port afterwards. I continued to use that version. That version has never worked correctly. After many builds and attempts, I finally decided to try my original version, which now shows the latest build working. Curious as to the cause, I went line by line to identify the culprit. This all boils down to one line of code:
When you simplified my code, you took the following:
Code: Select all conn:on("sent", function() WiFiclose() end)
function WiFiclose() conn:close() print(node.heap()) end
and converted it to:
Code: Select all conn:on("sent", function() print(node.heap()) end)
jankop further added conn:close() back in:
Code: Select all conn:on("sent", function() conn:close() print(node.heap()) end)
The smoking gun is the callback to the in-line function that executes conn:close(). This in-line function is not getting freed. My original code called a separately defined function that executed conn:close() and gets freed properly. This is the culprit. Bottom line: I believe this issue is now resolved. Now, I don't know if this brings up another issue where the in-line functions are not being freed.