@Wilberforce the best bet would be to tweak Telnet to add flow control in the firmware itself?
Telnet
It should be very easy. Just make: https://github.com/espruino/Espruino/blob/master/libs/network/telnet/jswrap_telnet.c#L292
Check jshHasEventSpaceForChars.
jshHasEventSpaceForChars
Maybe lower the buffer size a bit to make it a bit more fine-grained, but something like:
char buff[64]; if (!jshHasEventSpaceForChars(sizeof(buff))) return false; int r = netRecv(net, ST_NORMAL, tnSrv.cliSock-1, buff, sizeof(buff)); if (r > 0) { jshPushIOCharEvents(EV_TELNET, buff, (unsigned int)r); } else if (r < 0) { telnetRelease(net); }
would probably be perfect, and then TCP/IP should handle all the flow control stuff itself.
@Gordon started
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.
@Wilberforce the best bet would be to tweak
Telnet
to add flow control in the firmware itself?It should be very easy. Just make: https://github.com/espruino/Espruino/blob/master/libs/network/telnet/jswrap_telnet.c#L292
Check
jshHasEventSpaceForChars
.Maybe lower the buffer size a bit to make it a bit more fine-grained, but something like:
would probably be perfect, and then TCP/IP should handle all the flow control stuff itself.