Hello everyone, i'm programming a server/client program. My arduino will be server. My question is if there is a time out in client.read?if not how can i make one? my problem is here:
1)client sends 2 bytes
2)server(arduino) reads first, makes some checks to see what was the command
3)and then reads the second byte but sometimes read() returns -1
if i delay() the second read in server no problem!!! i need i time out in read to wait for reading unti a byte come but not forever.