Hi there,
I have this code which is nothing more than the usual for a web server:
#include <SPI.h>
#include <Ethernet.h>
#include "Model.h"
#include "Controller.h"
byte mac[] = { 0x90, 0xA2, 0xDA, 0x0D, 0x33, 0x89 };
IPAddress ip(10,0,0,177);
EthernetServer server(80);
void setup() {
pinMode(4,OUTPUT);
digitalWrite(4,HIGH);
Ethernet.begin(mac,ip);
server.begin();
}
void loop() {
if (EthernetClient client = server.available()) {
// do stuf with client here.
}
}
and I just discovered that: the server.available() call does not return "true" before the connected client sends its first byte.
Any idea why is this happening?