martin-ger / esp_wifi_repeater

A full functional WiFi Repeater (correctly: a WiFi NAT Router)
MIT License
4.83k stars 909 forks source link

TCP stack sending data in 256bytes of chunk from server but TCP client(Windows PC (Hercules.exe)) receives random size of chunk #505

Open cravalgasleak opened 2 years ago

cravalgasleak commented 2 years ago

I am using ESP32C3 as TCP server. I have used stack provided by you.

When I connect PC as TCP client and send data in 256bytes of chunk from ESP32C3(TCP server) to hercule.exe(TCP client) I am receiving random chunk of data in multiple of 256bytes and random chunks instead of exact 256bytes for each packets.

I have verified in wireshark.exe it shows TCP server is sending in multiple of 256bytes when issue occurred but in code I am hardcoding 256bytes every time to stream to client. If I add delay of 300ms after each packet sending to client I am getting data in 256bytes of chunk each time at client side. can somebody guide me through to understand why we require this 300ms delay and can we use TCP flags in place of delay to get exact 256bytes for each packet i stream from server?