Imagine connection established between client and server. If one of the participants has lost connection with the network for a short time, will socket still be valid? Mostly I interested in LWIP implementation but something tells me that answer is the same for any socket.
By the way, is it cool idea to change KEEP_ALIVE parameters to the order of seconds when very fast disconnection detection is required but for a short time?
By "connection lost" I mean physical reasons, like loosing connection to a wifi network.
If one of the participants has lost connection with the network for a short time, will socket still be valid?
It depends. Assuming that you mean TCP sockets: if no data had to be exchanged within this time then a short loss of connectivity does not matter at all. If instead data had to be exchanged or TCP keep alive was active then the connection might either degrade (slowing down and retrying to send data in case application data got not yet acknowledged) or get closed with error depending on how long the physical connection loss happened.
In case of UDP or raw sockets it does not care about lost data anyway so nothing important will happen.