I’m working on a general interrupt driven socket interface to W5500 using a RX600 from Renesas and FreeRTOS.
UDP communication seems to work well.
Although TCP communication with listen, send and receive works fine with interrupt system.
In the next step I want to make the driver more fault-tolerant to network errors or to unpredictable events.
Now I wonder why there is no interrupt for “Closed”.
What will happen if my interface receives a RST packet from a peer?
Let’s take for example the CONNECT command (0x04).
If the connect is successful I will get a CON interrupt (0).
At a timeout (ARP or TCP) there will be a TIMEOUT interrupt (3).
But what happens if the server sends a RST.
The socket changes to SOCK_CLOSED and according to the datasheet (page 47 in current 1.0.6) there is no interrupt.
In my event based interrupt system I have a task blocking wait on CON and TIMEOUT.
I can’t poll simultaneous the Sn_SR for SOCK_CLOSE because this would make the interrupt concept useless.
For the CONNECT command polling the Sn_SR won’t be a big problem because my embedded systems won’t call this function very often.
But as I understand RST packet can be received during communication all the time.
Does this mean I have to check Sn_SR for SOCK_CLOSE although during waiting for SEND_OK/RECV interrupts?
Thanks for any ideas.