JiriBilek / WiFiSpi

SPI library for Arduino AVR and STM32F1 to connect to ESP8266
GNU Lesser General Public License v3.0
62 stars 13 forks source link

Reason for limitation of 4 sockets? #30

Open fredlcore opened 3 years ago

fredlcore commented 3 years ago

Is there a hardware reason why the number of sockets is limited to 4? Or could the code be adjusted to allow for a (slightly) larger number, say, 8? If yes, could this be made configurable?

JiriBilek commented 3 years ago

The only reason is the limited memory on ESP8266. I think the number of connections could be rised up by changing the MAX_SOCK_NUM value in wl_definitions.h file. The same holds for the WiFiSpiESP project, the #define is in WiFiSPICmd.h. Feel free to try it and let me know if it works. Be warned that it would not work with TLS connections as they require rather big buffer (default 16KB) for communication and with more simultaneous connections you are out of memory on ESP8266.