I have a TCP client socket open and connected to a remote server. Right now I rely on the application layer code to time out to determine server side disconnect. Is there a way to do this at W5500 socket API layer? I am looking at the return code from recv(), it says:
ReturnsSuccess : The real received data size
SOCKERR_SOCKSTATUS - Invalid socket status for socket operation
SOCKERR_SOCKMODE - Invalid operation in the socket
SOCKERR_SOCKNUM - Invalid socket number
SOCKERR_DATALEN - zero data length
SOCK_BUSY - Socket is busy.
So, if getSn_RX_RSR() is positive but recv() isn’t, then all error code, except SOCK_BUSY, should lead to the socket close() on the client side. Correct?