Ethernet icon indicating copy to clipboard operation
Ethernet copied to clipboard

Possible bad value for MAX_SOCK_NUM

Open SukkoPera opened this issue 6 years ago • 0 comments

The following #ifdef:

#if defined(RAMEND) && defined(RAMSTART) && ((RAMEND - RAMSTART) <= 2048)
#define MAX_SOCK_NUM 4
#else
#define MAX_SOCK_NUM 8
#endif

shall be moved after line 51, i.e. after Arduino.h is included, otherwise RAMEND will never be defined (unless Arduino.h is explicitly included before Ethernet.h by the source file, which might not be the case in a library header).

Not doing this might cause MAX_SOCK_NUM to have different values in different compilation units, leading to failures when checking if a new client has connected or not.

SukkoPera avatar Oct 17 '18 18:10 SukkoPera