Closed drv53b6 closed 8 years ago
You may be overflowing the send buffer, which typically has a size of 1460 bytes, IIRC. This has been discussed before. @marcoskirsch wrote a clever http server that works around this issue by yielding. Try searching.
So need way to get current send buffer free size
Not that I know of, but check the Espressif's SDK docs to make sure. Currently, the chip will perform a callback to a dedicated function when it has sent out all of its data.
PS: I do not believe that the purpose of this bug tracker is to serve as a forum.. might want to keep that in mind.
raz123 - i dont now where is "forum" and how it good So no wey to send someting big? Realy need so many code for jast send big data? https://github.com/marcoskirsch/nodemcu-httpserver/blob/master/httpserver.lua
@drv53b6, search for "1460" at esp8266.com.
metod from https://github.com/marcoskirsch/nodemcu-httpserver/blob/master/httpserver.lua worck ok
nodemcu-httpserver (linked above) will send big files and it can handle multiple simultaneous requests.
@marcoskirsch yous metod from https://github.com/marcoskirsch/nodemcu-httpserver/blob/master/httpserver.lua is wrong. Becose you program send more data only after TCP conformation received from destination and send bufer complete clean, see strings 326-359 at https://github.com/nodemcu/nodemcu-firmware/blob/master/app/lwip/app/espconn_tcp.c For good need function what return free space in bufer, or need make SEND calback function called after any reducing of send buffer, and will be posible send fast, without waiting for every conformation. And coroutine.yield() not worck in some impotant way: https://github.com/nodemcu/nodemcu-firmware/issues/369
What do you mean by wrong? Do you mean: a) something is incorrect in the implementation or b) it could be faster if the firmware provided a way to query the empty space in the send buffer
@marcoskirsch wrong mean it the wrong way to do it
@drv53b6 what's the right way to do it?
@marcoskirsch send if have space in buffer or sleep till bufer reduced
I see, but there's no way to check how much space is available in the buffer, at least today, so there's nothing we can do better until the firmware adds, it right?
@marcoskirsch must use assembler inside LUA string for resolve this problem!
@drv53b6, can you show us your better method, with code? :P
@raz123 need make "net." callback for event "remove data from send,recive buffer"
@drv53b6, this issues list is primarily for reporting bugs. If you want to learn how to use the nodeMCU Lua RTS then why not ask your Qs on the ESP8266 forum? This is a design constraint informed by the limited RAM of the ESP8266 chip, and it is quite easy to code around. I feel that this issue should be closed.
@TerryE dont have way to continue sent data if have free space in send bufer (better if free space in TCP window), only posible continue send after come TCP conformation from distination
if after come TCP conformarion from distination have free space in TCP windows and have free space in send bufer - execute event "can_send" for this TCP connection ok- it to difficult for this small device
@drv53b6, I'd be pleased to help with your issue :smile: However, this isn't a bug in the firmware, so we shouldn't have this discussion here. Why not post a Q on the forum that I gave the link for and we can do it there. Also please post the necessary code fragment when you ask your Q.
@TerryE no one read this stuped forum
@drv53b6, you are trying to use tmr.delay()
, so this shows to me that you don't understand a key aspect of how the nodeMCU VM and RTS works. Places like the ESP8266 and StackOverflow forums are where you get this type of explanation; not here on an issues list, so this is my last post on this here.
@TerryE now im undestud
This is an SDK limitation
this code realy can send only 169 lines (169 line come to distination but loop finish ok), and some time make dead loop (c is net.socket)