Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
2 years, 4 months ago.
How to make restart UDP Socket if cable was unpluged?
I have UDP communication with Static IP between two NucleoF767ZI and encountered problem if I unplug cable and plug it again Ethernet communication never restores.
Can anybody advice how to check if connection was lost? (may be through mbedEvents) and how to restart UDP Socket ?
Thank you, Daniel
2 years, 3 months ago.
So, UDP is just fire-and-forget, so there's not really a thing as 'restarting a socket'. There's no communication between the two nodes to set up the connection.
If you need to be sure that the communication channel is still there, use TCP and look for the error codes when calling send/recv (or use the events that the socket gives you).