I'm working with sockets in embedded system communication. I create a thread to handle the connection, however as my system uses Wi-Fi connection I need to perform some sort of connection test before sending or receiving, in case this connection goes down I will treat it as soon as it reconnects. Would anyone have any idea how to perform this test?