Closed ramboerik closed 4 years ago
Hi @ramboerik Do not hesitate to provide a PR π This is a community project so any help are welcome.
Fix available in https://github.com/stm32duino/STM32Ethernet/pull/38. tested with larger packet sizes and it works. However, there is no timeout condition in the write loop and it expects that all data can sooner or later be sent by the stack below. if tcp_sndbuf(_tcp_client->pcb)
would be set to zero for eternity the write loop would hang. I don't know if that can happen but just pointing it out here.
Hi again π
I'm trying to send a bit larger packages and discovered that it isn't possible with the current implementation. The EthernetClient implementation passes all calls through to LwIP but LwIP's
tcp_write
refuses larger packages thanTCP_SND_BUF = 5840
. The doc fortcp_write
states:It should be up to the caller (in this case
EthernetClient::write
) to make multiple calls totcp_write
with the data length less thantcp_sndbuf()
.Current
tcp_write
call inEthernetClient::write
I guess a simple fix for this is to loop over
tcp_write
and split the buffer in smaller sizes if data length is larger thantcp_sndbuf()