Code: Select all
struct timeval to;
to.tv_sec = 3;
to.tv_usec = 0;
if (setsockopt(new_socket,SOL_SOCKET,SO_RCVTIMEO,&to,sizeof(to)) < 0)
{
Serial.printf("Unable to set read timeout on socket!");
return false;
}