Hi all,
I'm new to this forum, and I haven't found an answer to my problem anywhere else so hence this posting. I apologize if there is indeed an answer somewhere else.
I have an Arduino UNO with an Ethernet shield. I realize that the Ethernet shield has a max of 4 simultaneous connections. However, I'm experiencing problems with having more than 4 consecutive connections as well. That is, a client connects, reads the data, and disconnects. Then, later on, another client connects/reads/disconnections, etc. After 4 of these, it won't allow any more connections. My clients are doing the appropriate closing, etc. of the socket on their side, so this seems like an issue on the Arduino side to me.
The code I have on the Arduino side is prety simple:
byte mac[] = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 };
byte ip[] = { 192, 168, 1, 2 };
Server server = Server(23);
void setup()
{
pinMode(2, INPUT);
pinMode(3, INPUT);
Ethernet.begin(mac, ip);
server.begin();
}
void loop()
{
int button1 = digitalRead(2);
int button2 = digitalRead(3);
if (button1 == HIGH)
{
server.println('1');
}
if (button2 == HIGH)
{
server.println('2');
}
}
Anybody has any suggestions for how to solve this?
Thank you.