Hi, currently i am facing the following scenario:
Device 1 and 2 is an arduino board connected to a radio (Doodle Labs 20RM-2450-2J-XM) via ethernet cable. My task is to send data from device 1 to device 2.
device 1 performs:
client1.writeFully(message, sizeof(message))
device 2 performs
client2 = server.available();
cleint.read(buffer, sizeof(buffer));
where server is an EthernetServer object. and client[num] is an EthernetClient object.
a connection between an cleint1 on device 1 is already established with an server from device 2. and i received messages in device 2. To simulate a connection break i unplugged device 2 from its power source. However as soon as this happens my code on device 1 freezes on the method writeFully. Is there any way to set a timeout on device 1 to tell that it should stop trying to execute writeFully after a certain amount of time and move on with the rest of the code? Thank you