@@ -37,7 +37,7 @@ IPAddress subnet(255, 255, 0, 0);
37
37
// telnet defaults to port 23
38
38
EthernetServer server (23 );
39
39
40
- EthernetClient clients[4 ];
40
+ EthernetClient clients[8 ];
41
41
42
42
void setup () {
43
43
// You can use Ethernet.init(pin) to configure the CS pin
@@ -83,7 +83,7 @@ void loop() {
83
83
if (client) {
84
84
85
85
boolean newClient = true ;
86
- for (byte i=0 ; i < 4 ; i++) {
86
+ for (byte i=0 ; i < 8 ; i++) {
87
87
// check whether this client refers to the same socket as one of the existing instances:
88
88
if (clients[i] == client) {
89
89
newClient = false ;
@@ -93,7 +93,7 @@ void loop() {
93
93
94
94
if (newClient) {
95
95
// check which of the existing clients can be overridden:
96
- for (byte i=0 ; i < 4 ; i++) {
96
+ for (byte i=0 ; i < 8 ; i++) {
97
97
if (!clients[i] && clients[i] != client) {
98
98
clients[i] = client;
99
99
// clear out the input buffer:
@@ -111,7 +111,7 @@ void loop() {
111
111
// read the bytes incoming from the client:
112
112
char thisChar = client.read ();
113
113
// echo the bytes back to all other connected clients:
114
- for (byte i=0 ; i < 4 ; i++) {
114
+ for (byte i=0 ; i < 8 ; i++) {
115
115
if (clients[i] && (clients[i] != client)) {
116
116
clients[i].write (thisChar);
117
117
}
@@ -120,7 +120,7 @@ void loop() {
120
120
Serial.write (thisChar);
121
121
}
122
122
}
123
- for (byte i=0 ; i < 4 ; i++) {
123
+ for (byte i=0 ; i < 8 ; i++) {
124
124
if (!(clients[i].connected ())) {
125
125
// client.stop() invalidates the internal socket-descriptor, so next use of == will allways return false;
126
126
clients[i].stop ();
0 commit comments