Dear Mr. Eugeny!
As I see (W5500 tell) socket is hang in established state.
The keep-alive work in a way where peer send an ACK with sqn=actual sqn -1. As response the distant peer respond with ack contain actual sqn at ackn.
RFC973 describe TCP protocol. There is no restriction to send ack just after receiving data. For example peer S can send it any time and peer C must respond it. You may think peer cannot send ack contain sqn less than initial sqn, but for this no restriction defined in RFC973.
Moreover RFC1122 at 220.127.116.11 provide additional standards for keep-alive. But there is no restriction to send keep-alive just after first data exchange.
Therefore it is a vendor specific implementation of a keep-alive. I tested at lab and W5500 work in this way. At socket server side this will keep connection hung if no TCP packet received on established socket. As result, keep-alive sometimes works for socket server sometimes not.
This need to add manual keep-alive to socket keep-alive mechanism. As I see SEND_KEEP have a same problem if sqn = intial sqn.
Other solution is (can?). If I detect inactivity on socket server, then I disconnect socket using “DISCON” socket command. This way (I hope) not require to resetup a socket.
As I see on my post I do not “blaming” everybody, I ask for related experience and solution (workaround).