sock_close(): Time to fully close socket?

I’m using an RCM6600W with code which calls tcp_tick() just about once every 80ms.

If I establish a connection, receive a small amount of data, wait 15 seconds, and then call sock_close, I’ve found that waiting up to 30 seconds does not provide enough time to actually fully close the socket (ie sock_alive() still says the socket is alive after 30 seconds).

When sock_close is called, it looks like the rabbit sends out FIN/ACK when I’d think it should just be sending out FIN, and then waiting for a FIN/ACK from the server before finally accepting an ACK which closes the connection (if wikipedia is to be believed).

Not sure if there are proper deviations from the process, but I think things are breaking down as Windows never sends a FIN or a FIN/ACK in response to the rabbit’s FIN/ACK. I’m taking a look at how sock_close works behind the scenes right now and seeing if I can modify it to just send a FIN on close.

At that point hopefully everything will fall into place.

You may use sock_abort() to close a connection immediately.

1 Like