Why does clientRequestWrite in socketserver.c not kick off any transmission? I suppose the transmission only happens when the idle state is reached? Or am I missing something? Also, I don't understand https://github.com/espruino/Espruino/blob/master/libs/network/socketserver.c#L660, it seems to wipe out anything in the dSnd buffer, meaning that two consecutive calls to write overwrite each other?
NB: maybe "if it ain't broke don't fix it" applies here, but the intermingling of HTTP into plain sockets is not exactly clean. Makes it harder to figure out how to add MQTT or other protocols.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Is there a reason the network buffer for sending is so small: https://github.com/espruino/Espruino/blob/master/libs/network/socketserver.c#L218
On the esp8266 that will cause lots of tiny packets, which isn't good. Could I introduce a #define that gets set for different platforms to make this bigger in the esp8266 case?
Why does clientRequestWrite in socketserver.c not kick off any transmission? I suppose the transmission only happens when the idle state is reached? Or am I missing something? Also, I don't understand https://github.com/espruino/Espruino/blob/master/libs/network/socketserver.c#L660, it seems to wipe out anything in the dSnd buffer, meaning that two consecutive calls to write overwrite each other?
NB: maybe "if it ain't broke don't fix it" applies here, but the intermingling of HTTP into plain sockets is not exactly clean. Makes it harder to figure out how to add MQTT or other protocols.