Go Down

Topic: WifiChatServer example code error (Read 368 times) previous topic - next topic

AkeChristensson

Wifi and Wifi101 examples are not working with library versions:

Wifi101    0.14.0
Wifi          1.2.7


"server" on line 5 should be replaced by "client".

Incorrect code:

1    if (client.available() > 0) {
2      // read the bytes incoming from the client:
3      char thisChar = client.read();
4      // echo the bytes back to the client:
5      server.write(thisChar);
6    }

After making the described change the chat server became very reliable!


Go Up