posts/notifications crossed - I posted a reply/code here viewtopic.php?f=19&t=702&p=4467#p4467 before I saw your reply and 'redirection'...
yes8s wrote:I did a lot of testing on this today and I think by breaking up the data into packets manually, similar to the example zeroday presented here, I have a decent workaround. Not fully implemented yet but my plan is to count the length of each string or line that is being sent and when the counter exceeds a limit of something like 800 bytes I'll stop transmitting and wait for the next conn:send call to post the next chunk of data until all data is sent at which point I'll close the connection.
Hmmm, do you already have a plan how to do the "wait for the next conn:send call" as this call only reaches the (detached) callback-code?
I still would like to know what's happening behind the scenes in terms of when data via conn:send is actually being sent.
Me too
Perhaps a delay everynow and then to allow the buffers to be flushed could suffice. I don't know...
I still hope that zeroday can add a socket:flush() or implement something like socket:send(data,NOW) ....
Anyway, thanks for shedding some light on this. I was getting to the point of dumping Lua yesterday based on this issue and some other memory related problems and also random reboots.
Yes, sometimes there is some frustration arising
OTOH (and off topic), it's probably a matter of expectations - see, we have a ~4$ device that can connect to wifi and can be programmed to read sensors, control other devices and speak to the net - all this in an easy language without messing with strbuf's and malloc's Should we really complain about not beeing able to send files of arbitrary length?
Admittedly, I somehow got addicted to nodemcu, and meanwhile i have proof-of-concepts for serving files, sending mail, uploading files via HTTP, scheduling tasks... - all of which are nearly useless for 'production' due to memory constraints and I think maybe I should better start soldering in order to finally control my lights with the smartphone
Anyway, some things still should be ironed out and I hope the networking functions get attention...
Thomas