Closed everslick closed 7 years ago
the full message is send via one write call. In a normal architecture the splitting in to the right MTU size for TCP is jop of the network API / libs, but for the ESP I am not sure if its really is done for all cases.
at the first look i only find it for write_P / PGM_P: https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266WiFi/src/WiFiClient.cpp#L186-L202
for ASYNC I have implemented it: https://github.com/me-no-dev/ESPAsyncTCP/blob/master/src/ESPAsyncTCPbuffer.cpp#L103-L143
will take a deeper look at the weekend.
for the arduinoWebSockets it make no difference if the data is received in one TCP packet or if it splittet over multible ones. you will get one API call for one websocket message independent of the TCP packets needed.
Any news on this issue?
https://github.com/Links2004/arduinoWebSockets/commits/write_big_data may fix it, but no one has tested it yet.
write_big_data
is now part of master
I have observed that my JSON encoded data gets silently corrupted if the packet size is bigger then 2930 bytes. for demonstration i wrote the following sketch:
discussing this issue on gitter, MeNoDev explained:
That is so because that is the maximum size usually for the first outgoing window in order for it to send larger packets, you need to split them into MTU chunks and send when it's possible there is a bit more to that if you want to get the transmission as a single message on the other end.
/me has hoped, that arduinoWebSockets would handle this. no?