I have a piece of code connecting to a server to collect some data to put display in an LCD, but after some successful connections the EthernetClient fails to connect until I reset the board.
I had a look at the EthernetClient library and changed it to give different error codes (for me to understand what is stopping the program) and what makes my connection fail is this bit of code in EthernetClient.cpp line 39:
if (_sock != MAX_SOCK_NUM) return -10; //was 0, troubleshooting
As I read it, if the socket number is different than 4 it fails. Why is that? Especially since it is possible to define the socket number to use by doing
EthernetClient client(0); ?