Error: Invalid socket status for socket operation. Can anyone help?

Hi everyone. I’m using module W5500 to upload file to server via FTP protocol. I used library from the manufacturer on their website. As you can see from the picture below, each communication step between client and server is successful, except the last step. When client send the “QUIT” command, server responsed 220 code (close the connection) but the client received error (SOCKERR_SOCKSTATUS (SOCK_ERROR - 7) ///< Invalid socket status for socket operation in file Socket.h). I don’t know why this happened. I’m looking for your answers. Thank you so much.

It seems that the problem was caused by closing the socket due to the RST packet sent by the server before the message processing of the 220 code received from the server was completed.
I will check more and reply again.

Thanks for your reply. I noticed that there was a RST packet from the server but I dont know what its mean. This is the project I run successfully from a few month ago, and now when I run again, it becomes error like this.